logging for debugging
This commit is contained in:
parent
b720dfa352
commit
bdc67111b5
@ -95,7 +95,7 @@ class LoftService(Base):
|
|||||||
|
|
||||||
return solution
|
return solution
|
||||||
|
|
||||||
def recursive_solve(self, items, bundles_amount, attempts = 5000) -> LpProblem:
|
def recursive_solve(self, items, bundles_amount, attempts = 1000) -> LpProblem:
|
||||||
selected_bundles = solver_helper.get_random_bundles(
|
selected_bundles = solver_helper.get_random_bundles(
|
||||||
self.solver_run.total_form_items,
|
self.solver_run.total_form_items,
|
||||||
bundles_amount,
|
bundles_amount,
|
||||||
@ -107,7 +107,9 @@ class LoftService(Base):
|
|||||||
if LpStatus[problem.status] == 'Optimal' or attempts == 0:
|
if LpStatus[problem.status] == 'Optimal' or attempts == 0:
|
||||||
return problem
|
return problem
|
||||||
else:
|
else:
|
||||||
return self.recursive_solve(items, max, attempts - 1)
|
logging.info('recursing...')
|
||||||
|
logging.info(attempts)
|
||||||
|
return self.recursive_solve(items, bundles_amount, attempts - 1)
|
||||||
|
|
||||||
def solve(self, items: list[Item], bundles: list[Bundle] or None = None) -> LpProblem:
|
def solve(self, items: list[Item], bundles: list[Bundle] or None = None) -> LpProblem:
|
||||||
# create problem
|
# create problem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user