def cal(a, b, k):
""" a is the dictionary with the linguistic variables
for the criteria weights (or the linguistic
variables for the ratings), b is the matrix with
the criteria weights (or the ratings), and k is
the number of the decision makers. The output is
the fuzzy decision matrix or the fuzzy weights
of the criteria
"""
f = []
for i in range(len(b)):
c = []
for z in range(3):
x = 0
for j in range (k):
x = x + a[b[i][j]][z]
c.append(round(x / k, 3))
f.append(c)
return asarray(f)