You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x.status = ret ==0? _OPTIMIZE_OK : _OPTIMIZE_ERRORED
. Highs_run return value of 1 indicates a warning, -1 indicates an error.
Locally I've made the change below, adding an _OPTIMIZE_WARNED status to the _OptimizeStatus enum. In the case of a Highs_run warning, this lets me see more easily the MOI.TerminationStatus and MOI.RawStatusString, and act on the result. In my use case, I'm frequently encountering an optimal solution but with a warning. I'd like to know there's a warning and see the solver result rather than have it be shunted into MOI.OTHER_ERROR.
diff --git a/src/MOI_wrapper.jl b/src/MOI_wrapper.jl
index e485382..4aff9d3 100644
--- a/src/MOI_wrapper.jl
+++ b/src/MOI_wrapper.jl
@@ -162,7 +162,7 @@ function _set(c::_ConstraintInfo)
end
end
-@enum(_OptimizeStatus, _OPTIMIZE_NOT_CALLED, _OPTIMIZE_OK, _OPTIMIZE_ERRORED)
+@enum(_OptimizeStatus, _OPTIMIZE_NOT_CALLED, _OPTIMIZE_OK, _OPTIMIZE_ERRORED, _OPTIMIZE_WARNED)
"""
_Solution
@@ -1553,7 +1553,7 @@ Get the solution from a run of HiGHS.
"""
function _store_solution(model::Optimizer, ret::HighsInt)
x = model.solution
- x.status = ret == 0 ? _OPTIMIZE_OK : _OPTIMIZE_ERRORED
+ x.status = ret == kHighsStatusOk ? _OPTIMIZE_OK : ret == kHighsStatusWarning ? _OPTIMIZE_WARNED : _OPTIMIZE_ERRORED
x.primal_solution_status = kHighsSolutionStatusNone
x.dual_solution_status = kHighsSolutionStatusNone
x.has_dual_ray = false
The text was updated successfully, but these errors were encountered:
I find it a bit heavy that
model.solution.status
is set to_OPTIMIZE_ERRORED
for any nonzero return value ofHighs_run
, atHiGHS.jl/src/MOI_wrapper.jl
Line 1556 in 8e39503
Highs_run
return value of 1 indicates a warning, -1 indicates an error.Locally I've made the change below, adding an
_OPTIMIZE_WARNED
status to the_OptimizeStatus
enum. In the case of aHighs_run
warning, this lets me see more easily theMOI.TerminationStatus
andMOI.RawStatusString
, and act on the result. In my use case, I'm frequently encountering an optimal solution but with a warning. I'd like to know there's a warning and see the solver result rather than have it be shunted intoMOI.OTHER_ERROR
.The text was updated successfully, but these errors were encountered: