From af53add7424f3949e378c9ebe067a9ce868082a0 Mon Sep 17 00:00:00 2001 From: Henri Lefebvre Date: Wed, 11 Dec 2024 22:39:59 +0100 Subject: [PATCH] add SolutionLimit to reason --- lib/include/idol/general/utils/types.h | 5 ++++- .../optimizers/wrappers/Gurobi/Optimizers_Gurobi.cpp | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/include/idol/general/utils/types.h b/lib/include/idol/general/utils/types.h index 28efdad9..b519afe1 100644 --- a/lib/include/idol/general/utils/types.h +++ b/lib/include/idol/general/utils/types.h @@ -32,7 +32,8 @@ namespace idol { ObjLimit, Numerical, MemoryLimit, - Cycling + Cycling, + SolutionLimit }; template @@ -124,6 +125,8 @@ namespace idol { return t_os << "MemoryLimit"; case Cycling: return t_os << "Cycling"; + case SolutionLimit: + return t_os << "SolutionLimit"; default:; } diff --git a/lib/src/mixed-integer/optimizers/wrappers/Gurobi/Optimizers_Gurobi.cpp b/lib/src/mixed-integer/optimizers/wrappers/Gurobi/Optimizers_Gurobi.cpp index 2c39463e..78d644cd 100644 --- a/lib/src/mixed-integer/optimizers/wrappers/Gurobi/Optimizers_Gurobi.cpp +++ b/lib/src/mixed-integer/optimizers/wrappers/Gurobi/Optimizers_Gurobi.cpp @@ -67,6 +67,7 @@ std::pair idol::Optimizers::Gurobi:: case GRB_USER_OBJ_LIMIT: return {Feasible, ObjLimit }; case GRB_TIME_LIMIT: return { m_model.get(GRB_IntAttr_SolCount) > 0 ? Feasible : Infeasible, TimeLimit }; case GRB_NUMERIC: return {Fail, NotSpecified }; + case GRB_SOLUTION_LIMIT: return {Feasible, SolutionLimit }; default:; } throw Exception("Unsupported Gurobi status: " + std::to_string(t_status));