Skip to content

Commit

Permalink
More fix to appsi_copt
Browse files Browse the repository at this point in the history
  • Loading branch information
wujianjack committed Oct 13, 2023
1 parent 249c8a4 commit e6d784b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyomo/contrib/appsi/solvers/copt.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,13 @@ def _postsolve(self, timer: HierarchicalTimer):
results.best_feasible_objective = None
results.best_objective_bound = None
if self._objective is not None:
if self._solver_model.ismip:
if self._solver_model.ismip and self._solver_model.hasmipsol:
results.best_feasible_objective = self._solver_model.objval
results.best_objective_bound = self._solver_model.bestbnd
else:
elif (
self._solver_model.ismip == 0
and results.termination_condition == TerminationCondition.optimal
):
results.best_feasible_objective = self._solver_model.lpobjval
results.best_objective_bound = self._solver_model.lpobjval
if results.best_feasible_objective is not None and not math.isfinite(
Expand Down

0 comments on commit e6d784b

Please sign in to comment.