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)
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
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