Skip to content

Commit

Permalink
🐛 Update Direct solver to behave the same as Shell solver
Browse files Browse the repository at this point in the history
- In the case of `noSolution`, CPLEXSHELL now considers this a `warning` solver status
- Similarly, `GAMSDirect` returns a `SolutionStatus.unknown` so we should be consistent with that
  • Loading branch information
ruaridhw committed Mar 4, 2020
1 parent ac7790d commit 8693bb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyomo/solvers/plugins/solvers/cplex_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,9 @@ def _postsolve(self):
} or self._error_code == self._cplex.exceptions.error_codes.CPXERR_NO_SOLN:
# CPLEX doesn't have a solution status for `noSolution` so we assume this from the combination of
# maxTimeLimit + infeasible (instead of a generic `TerminationCondition.error`).
self.results.solver.status = SolverStatus.error
self.results.solver.status = SolverStatus.warning
self.results.solver.termination_condition = TerminationCondition.noSolution
soln.status = SolutionStatus.error
soln.status = SolutionStatus.unknown
else:
self.results.solver.status = SolverStatus.error
self.results.solver.termination_condition = TerminationCondition.error
Expand Down

0 comments on commit 8693bb2

Please sign in to comment.