more extensive logging
This commit is contained in:
@ -88,6 +88,7 @@ class LoftService(Base):
|
||||
problem = solver_helper.build_constraints(self.solver_run, problem, items, bundles)
|
||||
|
||||
# multi-objective constraints
|
||||
logging.info('Creating TIF and TCC constraints')
|
||||
for target in self.solver_run.objective_function.tif_targets:
|
||||
problem += lpSum([item.iif(self.solver_run, target.theta)*items[item.id]
|
||||
for item in self.solver_run.items]) >= target.value - 8, f'max tif theta ({target.theta}) target value {target.value}'
|
||||
@ -101,13 +102,16 @@ class LoftService(Base):
|
||||
for item in self.solver_run.items]) <= target.value + 20, f'min tcc theta ({target.theta}) target value {target.value}'
|
||||
|
||||
# solve problem
|
||||
logging.info('Solving...')
|
||||
problem.solve()
|
||||
logging.info('Solved...generating form and adding to solution')
|
||||
|
||||
# add return items and create as a form
|
||||
form_items = service_helper.solution_items(problem.variables(), self.solver_run)
|
||||
|
||||
# add form to solution
|
||||
solution.forms.append(Form.create(form_items, self.solver_run, LpStatus[problem.status]))
|
||||
logging.info('Form generated and added to solution...')
|
||||
|
||||
# successfull form, increment
|
||||
f += 1
|
||||
|
Reference in New Issue
Block a user