Skip to content

Commit

Permalink
add SolutionLimit to reason
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Dec 11, 2024
1 parent a15d517 commit af53add
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/include/idol/general/utils/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ namespace idol {
ObjLimit,
Numerical,
MemoryLimit,
Cycling
Cycling,
SolutionLimit
};

template<class T>
Expand Down Expand Up @@ -124,6 +125,8 @@ namespace idol {
return t_os << "MemoryLimit";
case Cycling:
return t_os << "Cycling";
case SolutionLimit:
return t_os << "SolutionLimit";
default:;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ std::pair<idol::SolutionStatus, idol::SolutionReason> 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));
Expand Down

0 comments on commit af53add

Please sign in to comment.