Antares Simulator
Power System Simulator
Antares::Optimisation::LinearProblemMpsolverImpl::OrtoolsLinearProblem Class Reference
Inheritance diagram for Antares::Optimisation::LinearProblemMpsolverImpl::OrtoolsLinearProblem:
Antares::Optimisation::LinearProblemApi::ILinearProblem Antares::Optimization::LegacyOrtoolsLinearProblem

Public Member Functions

 OrtoolsLinearProblem (bool isMip, const std::string &solverName)
 
LinearProblemApi::IMipVariableaddNumVariable (double lb, double ub, const std::string &name) override
 Create a continuous variable.
 
LinearProblemApi::IMipVariableaddIntVariable (double lb, double ub, const std::string &name) override
 Create a integer variable.
 
LinearProblemApi::IMipVariableaddVariable (double lb, double ub, bool integer, const std::string &name) override
 Create a continuous or integer variable.
 
const std::vector< std::unique_ptr< LinearProblemApi::IMipVariable > > & getVariables () const override
 
LinearProblemApi::IMipVariablegetVariable (std::size_t index) const override
 
LinearProblemApi::IMipVariablelookupVariable (const std::string &name) const override
 
int variableCount () const override
 
LinearProblemApi::IMipConstraintaddConstraint (double lb, double ub, const std::string &name) override
 Add a bounded constraint to the problem.
 
const std::vector< std::unique_ptr< LinearProblemApi::IMipConstraint > > & getConstraints () const override
 
LinearProblemApi::IMipConstraintgetConstraint (std::size_t index) const override
 
LinearProblemApi::IMipConstraintlookupConstraint (const std::string &name) const override
 
int constraintCount () const override
 
void setObjectiveCoefficient (LinearProblemApi::IMipVariable *var, double coefficient) override
 Set the objective coefficient for a given variable.
 
double getObjectiveCoefficient (const LinearProblemApi::IMipVariable *var) const override
 
void setObjectiveOffset (double objectiveOffset) override
 Sets the constant offset for the objective function. More...
 
double getObjectiveOffset () const override
 Returns the current objective offset value. More...
 
void setMinimization () override
 Sets the optimization direction to minimize.
 
void setMaximization () override
 Sets the optimization direction to maximize.
 
bool isMinimization () const override
 
bool isMaximization () const override
 
OrtoolsMipSolutionsolve (bool verboseSolver) override
 Solve the problem, returns a IMipSolution.
 
OrtoolsMipSolutionsolution (bool verboseSolver)
 
double objectiveValue () const override
 
double infinity () const override
 
bool isLP () const override
 

Protected Member Functions

operations_research::MPSolver * MpSolver () const
 

Friends

void Write (const OrtoolsLinearProblem &problem, const std::filesystem::path &path)
 

Member Function Documentation

◆ getObjectiveOffset()

double Antares::Optimisation::LinearProblemMpsolverImpl::OrtoolsLinearProblem::getObjectiveOffset ( ) const
overridevirtual

Returns the current objective offset value.

Retrieves the constant term currently added to the objective function. For the Sirius solver, this value is stored locally; for other solvers, it uses OR-Tools' native support.

Returns
The current objective offset.

Implements Antares::Optimisation::LinearProblemApi::ILinearProblem.

◆ setObjectiveOffset()

void Antares::Optimisation::LinearProblemMpsolverImpl::OrtoolsLinearProblem::setObjectiveOffset ( double  objectiveOffset)
overridevirtual

Sets the constant offset for the objective function.

The objective offset is a constant term added to the objective function. It shifts the objective value but does not affect the optimal solution. For the Sirius solver, this value is stored locally; for other solvers, it uses OR-Tools' native support.

Parameters
objectiveOffsetThe constant offset to add to the objective function.

Implements Antares::Optimisation::LinearProblemApi::ILinearProblem.

◆ solution()

OrtoolsMipSolution * Antares::Optimisation::LinearProblemMpsolverImpl::OrtoolsLinearProblem::solution ( bool  verboseSolver)

Return the last solution or solve if no solution exist.

Parameters
verboseSolver
Returns
The solution

The documentation for this class was generated from the following files: