logging for debugging

This commit is contained in:
Joshua Burman 2022-02-09 14:05:18 -05:00
parent b720dfa352
commit bdc67111b5

View File

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