def __init__(self, moipProblem): #override parent initializer CwmoipSol.__init__(self, moipProblem) #represent the coefficient of the original inequation constraints self.origi_A = [] #represent the right side value of the original inequation constraints self.origi_B = [] #represent the coefficient of the original equation constraints self.origi_Aeq = [] #represent the right side value of the original equation constraints self.origi_Beq = [] #represent the coefficient of the extra inequation constraints self.extra_A = [] #represent the right side value of the extra inequation constraints self.extra_B = [] #represent the coefficient of the extra equation constraints self.extra_Aeq = [] #represent the right side value of the extra equation constraints self.extra_Beq = [] self.utopiaPlane = None self.pGenerator = None self.objNo = moipProblem.objectiveCount self.varNv = moipProblem.featureCount self.builtEqualAndInequalMaps(moipProblem)
reader.displayConstraintEquationNum() prob = MOIPProblem(len(reader.objectNames), len(reader.featureNames), len(reader.objectNames) - 1) prob.displayObjectiveCount() prob.displayFeatureCount() prob.exetractFromFile(moipInputFile) prob.displayObjectives() #prob.displayVariableNames() #prob.displayObjectiveSparseMapList() prob.displaySparseInequationsMapListCount() prob.displaySparseEquationsMapListCount() #prob.displayAttributeMatrix() time_start = time.time() sol = CwmoipSol(prob) sol.prepare() sol.execute() time_end = time.time() exec_time = time_end - time_start sol.outputCplexParetoMap(paretoOutputFile) sol.outputFullCplexResultMap(fullResultOutputFile) sol.displaySolvingAttempts() sol.displayObjsBoundsDictionary() sol.displayCplexSolutionSetSize() sol.displayCplexResultMap() sol.displayFullCplexResultMap() sol.displayCplexParetoSet() print("Solving time", exec_time) #sol.displayVariableLowerBound() #sol.displayVariableUpperBound()
def __CwmoipSol(self) -> None: self.__solver = CwmoipSol(self.__problem)