Example #1
0
 def deNuutrosophicMatrix(self, matrix):
     result = copy.deepcopy(matrix)
     x = Ivns(0, 0, 0, 0, 0, 0)
     for i in range(len(matrix)):
         for j in range(len(matrix[0])):
             result[i][j] = round(x.deNeutrosophic(matrix[i][j]), 3)
     return result
Example #2
0
    def lambdamax(self, arr, w):

        Rindex = [0, 0, 0, 0.58, 0.9, 1.12, 1.24, 1.32, 1.41, 1.45, 1.49]

        sum = 0
        x = Ivns(0, 0, 0, 0, 0, 0)
        for i in range(len(arr)):
            sum = sum + float(arr[i]) / x.deNeutrosophic(w[i])

        result = sum / len(arr)
        result = result - len(arr)
        result = result / (len(arr) - 1)

        result = result / Rindex[len(arr)]
        result = round(result, 4)
        return result
Example #3
0
    def getDivDirect(self, listj, col):
        divResult = Ivns(0, 0, 0, 0, 0, 0)

        divResult.tl = round(float(listj.tl) / float(col.tl), 3)
        divResult.tu = round(float(listj.tu) / float(col.tu), 3)
        divResult.il = round(float(listj.il) / float(col.il), 3)
        divResult.iu = round(float(listj.iu) / float(col.iu), 3)
        divResult.fl = round(float(listj.fl) / float(col.fl), 3)
        divResult.fu = round(float(listj.fu) / float(col.fu), 3)

        return divResult
Example #4
0
    def getSumDirectForRow(self, matrix, row):
        sum = Ivns(0, 0, 0, 0, 0, 0)

        for j in range(len(matrix[0])):
            sum.tl = round(sum.tl + float(matrix[row][j].tl), 3)
            sum.tu = round(sum.tu + float(matrix[row][j].tu), 3)
            sum.il = round(sum.il + float(matrix[row][j].il), 3)
            sum.iu = round(sum.iu + float(matrix[row][j].iu), 3)
            sum.fl = round(sum.fl + float(matrix[row][j].fl), 3)
            sum.fu = round(sum.fu + float(matrix[row][j].fu), 3)
        return sum
Example #5
0
    def getSumDirect(self, listj, col):
        sum = Ivns(0, 0, 0, 0, 0, 0)

        for row in listj:
            sum.tl = round(sum.tl + float(row[col].tl), 3)
            sum.tu = round(sum.tu + float(row[col].tu), 3)
            sum.il = round(sum.il + float(row[col].il), 3)
            sum.iu = round(sum.iu + float(row[col].iu), 3)
            sum.fl = round(sum.fl + float(row[col].fl), 3)
            sum.fu = round(sum.fu + float(row[col].fu), 3)

        return sum
Example #6
0
    def deNuutrosophicSum(self, matrix):
        sum = 0
        rowSum = []
        x = Ivns(0, 0, 0, 0, 0, 0)
        for i in range(len(matrix)):
            for j in range(len(matrix[0])):
                sum = sum + matrix[i][j]
            sum = round(sum, 3)
            rowSum.append(sum)
            sum = 0

        return rowSum
Example #7
0
 def matrixGetCriteriaWeight(self, matrix):
     listj = IvnM('')
     result = []
     sumj = None
     NumOfCriteria = len(matrix)
     divideBy = Ivns(NumOfCriteria, NumOfCriteria, NumOfCriteria,
                     NumOfCriteria, NumOfCriteria, NumOfCriteria)
     for i in range(NumOfCriteria):
         sumj = listj.getSumDirectForRow(matrix, i)
         sumj = self.getDivDirect(sumj, divideBy)
         result.append(sumj)
     return result
Example #8
0
    def linearSum(self, x, xmax, xmin, beneficial):
        ivns = Ivns(0, 0, 0, 0, 0, 0)
        MaxMinDiff = ivns.Difference(xmax, xmin)
        if beneficial:
            overPart = ivns.Difference(x, xmin)
        else:
            overPart = ivns.Difference(xmax, x)

        return ivns.Division(overPart, MaxMinDiff)
Example #9
0
 def Create(self):
     matrix = []
     text = self.text.split('\n')
     for line in text:
         items = line.split('  ')
         row = []
         for item in items:
             item = item.translate({ord(i): None for i in '<>[]'})
             item = item.translate({ord(i): None for i in ' '})
             numbers = item.split(',')
             ivns = Ivns(
                 numbers[0],
                 numbers[1],
                 numbers[2],
                 numbers[3],
                 numbers[4],
                 numbers[5],
             )
             row.append(ivns)
         matrix.append(row)
     return matrix
Example #10
0
 def getSquareSum(self, listj, col):
     sum = Ivns(0, 0, 1, 1, 1, 1)
     maxitem = None
     for row in listj:
         sum = sum.Addition(sum, row[col].Power(2))
     return sum
Example #11
0
 def getSumOfXDiffMin(self, listj, col, xmin):
     sum = Ivns(0, 0, 1, 1, 1, 1)
     maxitem = None
     for row in listj:
         sum = sum.Addition(sum, sum.Difference(row[col], xmin))
     return sum
Example #12
0
 def getSumOfMaxDiffX(self, listj, col, xmax):
     sum = Ivns(0, 0, 1, 1, 1, 1)
     maxitem = None
     for row in listj:
         sum = sum.Addition(sum, sum.Difference(xmax, row[col]))
     return sum
Example #13
0
 def getSum(self, listj, col):
     sum = Ivns(0, 0, 1, 1, 1, 1)
     for row in listj:
         sum = sum.Addition(sum, row[col])
     return sum