make the print problem optional in local dev
This commit is contained in:
parent
ee77d888b5
commit
a61c7a82b9
@ -112,8 +112,9 @@ def solution_items(variables, solver_run):
|
|||||||
|
|
||||||
return form_items
|
return form_items
|
||||||
|
|
||||||
def print_problem_logs(problem):
|
def print_problem_variables(problem):
|
||||||
print(problem);
|
# Uncomment this as needed in local dev
|
||||||
|
# print(problem);
|
||||||
for v in problem.variables(): print(v.name, "=", v.varValue);
|
for v in problem.variables(): print(v.name, "=", v.varValue);
|
||||||
|
|
||||||
# probably a better place for this...
|
# probably a better place for this...
|
||||||
|
@ -160,8 +160,8 @@ class LoftService(Base):
|
|||||||
if LpStatus[problem.status] == 'Infeasible':
|
if LpStatus[problem.status] == 'Infeasible':
|
||||||
logging.info(f'attempt infeasible for drift of {current_drift}%')
|
logging.info(f'attempt infeasible for drift of {current_drift}%')
|
||||||
|
|
||||||
if current_drift == Target.max_drift(): # this is the last attempt, so lets finalize the solution
|
if current_drift >= Target.max_drift(): # this is the last attempt, so lets finalize the solution
|
||||||
if ApplicationConfigs.local_dev_env: service_helper.print_problem_logs(problem);
|
if ApplicationConfigs.local_dev_env: service_helper.print_problem_variables(problem);
|
||||||
|
|
||||||
logging.info(f'No feasible solution found for Form {form_number}!')
|
logging.info(f'No feasible solution found for Form {form_number}!')
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ class LoftService(Base):
|
|||||||
|
|
||||||
current_drift += Target.max_drift_increment()
|
current_drift += Target.max_drift_increment()
|
||||||
else:
|
else:
|
||||||
if ApplicationConfigs.local_dev_env: service_helper.print_problem_logs(problem);
|
if ApplicationConfigs.local_dev_env: service_helper.print_problem_variables(problem);
|
||||||
|
|
||||||
logging.info(f'Optimal solution found with drift of {current_drift}%!')
|
logging.info(f'Optimal solution found with drift of {current_drift}%!')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user