Skip to content

Commit

Permalink
fix gurobi single tree termination check bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed Nov 1, 2023
1 parent dec70eb commit 905503b
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions pyomo/contrib/mindtpy/single_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,19 +910,7 @@ def LazyOACallback_gurobi(cb_m, cb_opt, cb_where, mindtpy_solver, config):
if mindtpy_solver.dual_bound != mindtpy_solver.dual_bound_progress[0]:
mindtpy_solver.add_regularization()

if (
abs(mindtpy_solver.primal_bound - mindtpy_solver.dual_bound)
<= config.absolute_bound_tolerance
):
config.logger.info(
'MindtPy exiting on bound convergence. '
'|Primal Bound: {} - Dual Bound: {}| <= (absolute tolerance {}) \n'.format(
mindtpy_solver.primal_bound,
mindtpy_solver.dual_bound,
config.absolute_bound_tolerance,
)
)
mindtpy_solver.results.solver.termination_condition = tc.optimal
if mindtpy_solver.bounds_converged() or mindtpy_solver.reached_time_limit():
cb_opt._solver_model.terminate()
return

Expand Down

0 comments on commit 905503b

Please sign in to comment.