Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver options : when MILP, forbid to use options for optim 1 or 2 #2697

Open
wants to merge 1 commit into
base: feature/add-solver-options-for-optim-1-and-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/libs/antares/checks/checksOnLPsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ void checkSolverMILPoptionsConsistency(const OptimizationOptions& solverOptions)
{
throw Error::IncompatibleMILPOrtoolsSolver();
}

bool UserSuppliedParamsOptim1 = !solverOptions.lpSolverParamOptim1.empty();
bool UserSuppliedParamsOptim2 = !solverOptions.lpSolverParamOptim2.empty();
if(UserSuppliedParamsOptim1 || UserSuppliedParamsOptim2)
{
throw Error::UseMILPsolverWithWrongOptions();
}
}

void checkForSolverOptionsConsistency(const OptimizationOptions& solverOptions)
Expand Down
6 changes: 6 additions & 0 deletions src/libs/antares/exception/LoadingError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ IncompatibleMILPOrtoolsSolver::IncompatibleMILPOrtoolsSolver():
{
}

UseMILPsolverWithWrongOptions::UseMILPsolverWithWrongOptions():
LoadingError("'milp' solver cannot be used with options for optimization 1 or 2")
{
}


IncompatibleOptRangeHydroPricing::IncompatibleOptRangeHydroPricing():
LoadingError("Simplex optimization range and hydro pricing mode : values are not compatible ")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ class IncompatibleMILPOrtoolsSolver: public LoadingError
IncompatibleMILPOrtoolsSolver();
};

class UseMILPsolverWithWrongOptions: public LoadingError
{
public:
UseMILPsolverWithWrongOptions();
};

class IncompatibleOptRangeHydroPricing: public LoadingError
{
public:
Expand Down
Loading