Find maximums
alphasF = []
centrosM = []
for i in range(0,nc):
aux = 0
for j in range(0,nr):
if(auxreglas[j][i] > aux):
aux = auxreglas[j][i]
alphasF.append(aux)
centrosM.append(self.output[i].getCenMax())
num = 0
den = 0
for i in range(0,nc):
num = num + alphasF[i]*centrosM[i]
den = den + alphasF[i]
if (den!=0):
res = num/den
self.vn = res
return self.vn
else:
return 0
```
return [self.p1,self.p2]

self.input1 = input1 # error

self.input2 = input2 # derivada

def \_\_init\_\_(self, input1, input2, outputs, rules):

auxreglas = [[0, 0, 0, 0, 1], [0, 0, 0, 0, 1], [0, 0, 0, 0, 1],

[0, 0, 0, 1, 0], [0, 0, 0, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 1, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0]]

class FuzzySystem:

188 Automation and Control Trends

self.output = outputs

def evaluar(self, x, y):

nr = len(auxreglas) #inputs

nr = len(auxreglas) # inputs

nE = len(self.input1) nD = len(self.input2)
