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