sneaky update: add multi-objective functions
This commit is contained in:
@ -43,7 +43,12 @@ class Problem(BaseModel):
|
||||
|
||||
def solve(self, solver_run: SolverRun, enemy_ids: List[int] = []) -> LpProblem:
|
||||
logging.info('solving problem...')
|
||||
self.problem.solve()
|
||||
|
||||
# creating problem multi-objective functions
|
||||
objective_functions = solver_run.objective_function.for_problem(self, solver_run)
|
||||
self.problem.sequentialSolve(objective_functions)
|
||||
|
||||
return self.problem
|
||||
|
||||
# NOTICE: Legacy enemies implementation
|
||||
# leaving this in, just in case the current impl fails to function
|
||||
@ -106,9 +111,6 @@ class Problem(BaseModel):
|
||||
|
||||
def generate(self, solution: Solution, solver_run: SolverRun) -> None:
|
||||
try:
|
||||
# creating problem objective function
|
||||
solver_run.objective_function.for_problem(self)
|
||||
|
||||
logging.info('Creating Constraints...')
|
||||
# generic constraints
|
||||
for constraint in solver_run.constraints:
|
||||
|
Reference in New Issue
Block a user