From bdc67111b5b38081e2c83e6326b77dbeffdf2f59 Mon Sep 17 00:00:00 2001 From: Joshua Burman Date: Wed, 9 Feb 2022 14:05:18 -0500 Subject: [PATCH] logging for debugging --- app/services/loft_service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/loft_service.py b/app/services/loft_service.py index 4f20817..c767388 100644 --- a/app/services/loft_service.py +++ b/app/services/loft_service.py @@ -95,7 +95,7 @@ class LoftService(Base): 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( self.solver_run.total_form_items, bundles_amount, @@ -107,7 +107,9 @@ class LoftService(Base): if LpStatus[problem.status] == 'Optimal' or attempts == 0: return problem 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: # create problem