Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
BendersBaseDouble Class Reference
Inheritance diagram for BendersBaseDouble:
BendersBase

Public Member Functions

 BendersBaseDouble (const BendersBaseOptions &options, Logger &logger, std::shared_ptr< Output::OutputWriter > writer, std::shared_ptr< MathLoggerDriver > mathLoggerDriver)
 
void free () override
 
void launch () override
 
std::string BendersName () const override
 
void InitializeProblems () override
 
void Run () override
 
void get_master_value () override
 Solve and get optimal variables of the Master Problem.
 
void init_data () override
 Initialize set of data used in the loop.
 
void UpdateTrace () override
 Update trace of the Benders for the current iteration.
 
void post_run_actions () const override
 
void EndWritingInOutputFile () const override
 
void SaveCurrentBendersData () override
 
void write_basis () const override
 
void set_data (Point x_out, Point x_in)
 
void set_invest_bounds (Point min_invest, Point max_invest)
 
void set_iteration (int it)
 
Point get_x_cut () const
 
virtual void ComputeXCut ()
 
- Public Member Functions inherited from BendersBase
 BendersBase (BendersBaseOptions options, Logger logger, std::shared_ptr< Output::OutputWriter > writer, std::shared_ptr< MathLoggerDriver > mathLoggerDriver)
 
void set_solver_log_file (const std::filesystem::path &log_file)
 
double execution_time () const
 
WorkerMasterDataVect AllCuts () const
 
LogData GetBestIterationData () const
 
void set_input_map (const CouplingMap &coupling_map)
 set the input
 
int MasterRowIndex (const std::string &row_name) const
 
void MasterChangeRhs (int id_row, double val) const
 
void MasterGetRhs (double &rhs, int id_row) const
 
const VariableMap & MasterVariables () const
 
std::vector< double > MasterObjectiveFunctionCoeffs () const
 
void MasterRowsCoeffs (std::vector< int > &mstart, std::vector< int > &mclind, std::vector< double > &dmatval, int size, std::vector< int > &nels, int first, int last) const
 
int MasterGetNElems () const
 
void MasterAddRows (const std::vector< char > &qrtype_p, const std::vector< double > &rhs_p, const std::vector< double > &range_p, const std::vector< int > &mstart_p, const std::vector< int > &mclind_p, const std::vector< double > &dmatval_p, const std::vector< std::string > &row_names={}) const
 
void MasterGetRowType (std::vector< char > &qrtype, int first, int last) const
 
void ResetMasterFromLastIteration ()
 
std::filesystem::path LastMasterPath () const
 
bool MasterIsEmpty () const
 
void DoFreeProblems (bool free_problems)
 
int MasterGetnrows () const
 
int MasterGetncols () const
 
WorkerMasterData BestIterationWorkerMaster () const
 
void SetMasterObjectiveFunctionCoeffsToZeros () const
 
void SetMasterObjectiveFunction (const double *coeffs, int first, int last) const
 
void SetMaxIteration (int max_iteration)
 
BendersBaseOptions Options () const
 
int GetBendersRunNumber () const
 
CurrentIterationData GetCurrentIterationData () const
 
CriteriaCurrentIterationData GetOuterLoopData () const
 
std::vector< double > GetOuterLoopCriterionAtBestBenders () const
 
void init_data (double external_loop_lambda, double external_loop_lambda_min, double external_loop_lambda_max)
 
Output::SolutionData GetOuterLoopSolution () const
 
void SaveOuterLoopSolutionInOutputFile () const
 
void SaveCurrentOuterLoopIterationInOutputFile () const
 
void SetBilevelBestub (double bilevel_best_ub)
 
void UpdateOuterLoopSolution ()
 
bool isExceptionRaised () const
 
void UpdateOverallCosts ()
 
void setCriterionComputationInputs (const Benders::Criterion::CriterionInputData &criterion_input_data)
 

Public Attributes

CurrentIterationData _data
 
- Public Attributes inherited from BendersBase
Logger _logger
 
std::shared_ptr< Output::OutputWriter_writer
 
std::shared_ptr< MathLoggerDrivermathLoggerDriver_
 
std::once_flag variable_indice_once_flag
 

Protected Member Functions

bool shouldParallelize () const final
 
- Protected Member Functions inherited from BendersBase
void update_best_ub ()
 Update best upper bound and best optimal variables.
 
bool ShouldBendersStop ()
 
bool is_initial_relaxation_requested () const
 
bool SwitchToIntegerMaster (bool is_relaxed) const
 
virtual void HandleInitialMasterRelaxation ()
 
void roundXCut ()
 
void ComputeInvestCost ()
 
virtual void compute_ub ()
 
void GetSubproblemCut (SubProblemDataMap &subproblem_data_map)
 Solve and store optimal variables of all Subproblem Problems.
 
void GetSubproblemCutFast (SubProblemDataMap &subproblem_data_map)
 
std::pair< std::vector< int >, std::vector< int > > GetProblemBasis (const std::shared_ptr< SubproblemWorker > &worker) const
 
std::shared_ptr< SubproblemWorkerBuildProblem (const std::pair< std::string, VariableMap > &kvp, const std::string &name)
 
std::shared_ptr< SubproblemWorkermakeSubproblemWorker (const std::pair< std::string, VariableMap > &kvp) const
 
void GetSubproblemCutCache (SubProblemDataMap &subproblem_data_map)
 
void BuildCutFull (const SubProblemDataMap &subproblem_data_map)
 Add cuts in master problem.
 
virtual void DeactivateIntegrityConstraints () const
 
virtual void ActivateIntegrityConstraints () const
 
virtual void SetDataPreRelaxation ()
 
virtual void ResetDataPostRelaxation ()
 
std::filesystem::path GetSubproblemPath (const std::string &subproblem_name) const
 Get path to subproblem mps file from options.
 
double SubproblemWeight (int subproblem_count, const std::string &name) const
 Return subproblem weight value.
 
std::filesystem::path get_master_path () const
 Get path to master problem mps file from options.
 
std::filesystem::path get_structure_path () const
 
LogData bendersDataToLogData (const CurrentIterationData &data) const
 
template<typename T , typename... Args>
void reset_master (Args &&... args)
 
void free_master ()
 
void free_subproblems ()
 
void AddSubproblem (const std::pair< std::string, VariableMap > &kvp)
 
virtual WorkerMasterPtr get_master () const
 
void MatchProblemToId ()
 
void AddSubproblemName (const std::string &name)
 
std::string get_master_name () const
 
std::string get_solver_name () const
 
int get_log_level () const
 
bool is_trace () const
 
Point get_x_cut () const
 
void set_x_cut (const Point &x0)
 
Point get_x_out () const
 
void set_x_out (const Point &x0)
 
double GetSubproblemCost () const
 
void SetSubproblemCost (const double &subproblem_cost)
 
bool IsResumeMode () const
 
std::filesystem::path LastIterationFile () const
 
void UpdateMaxNumberIterationResumeMode (int nb_iteration_done)
 
void SaveCurrentIterationInOutputFile () const
 
void SaveSolutionInOutputFile () const
 
void PrintCurrentIterationCsv ()
 
void OpenCsvFile ()
 
void CloseCsvFile ()
 
void ChecksResumeMode ()
 
void ClearCurrentIterationCutTrace ()
 
int GetNumIterationsBeforeRestart () const
 
double GetBendersTime () const
 
SubproblemsMapPtr GetSubProblemMap () const
 
StrVector GetSubProblemNames () const
 
double AbsoluteGap () const
 
double RelativeGap () const
 
double RelaxedGap () const
 
DblVector GetAlpha_i () const
 
void SetAlpha_i (const DblVector &single_subpb_costs_under_approx)
 
int ProblemToId (const std::string &problem_name) const
 
virtual void UpdateStoppingCriterion ()
 Update stopping criterion.
 
virtual bool ShouldRelaxationStop () const
 Check if initial relaxation should stop.
 
int GetNumOfSubProblemsSolvedBeforeResume ()
 
void BoundSimplexIterations (int subproblem_iteration)
 
void ResetSimplexIterationsBounds ()
 
virtual void SolveSubproblem (PlainData::SubProblemData &subproblem_data, const std::string &name, const std::shared_ptr< SubproblemWorker > &worker)
 
void SetSubproblemVariablesIndices (const SubproblemWorker &subproblem)
 
void SetSubproblemsVariablesIndices ()
 

Additional Inherited Members

- Protected Attributes inherited from BendersBase
bool exception_raised_ = false
 
CurrentIterationData _data
 
WorkerMasterDataVect workerMasterDataVect_
 
VariableMap master_variable_map_
 
CouplingMap coupling_map_
 
BendersRelevantIterationsData relevantIterationData_ = {WorkerMasterData(), WorkerMasterData()}
 
bool init_data_ = true
 
bool init_problems_ = true
 
bool free_problems_ = true
 
BendersBaseOptions _options
 
std::vector< std::vector< double > > criteria_vector_for_each_iteration_
 
bool is_bilevel_check_all_ = false
 
SubproblemsMapPtr subproblem_map
 
SolverLogManager solver_log_manager_
 
Benders::Criterion::CriterionComputation criterion_computation_
 

Member Function Documentation

◆ BendersName()

std::string BendersBaseDouble::BendersName ( ) const
inlineoverridevirtual

Implements BendersBase.

◆ ComputeXCut()

void BendersBase::ComputeXCut ( )
virtual

Reimplemented from BendersBase.

◆ EndWritingInOutputFile()

void BendersBaseDouble::EndWritingInOutputFile ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.

◆ free()

void BendersBaseDouble::free ( )
inlineoverridevirtual

Implements BendersBase.

◆ get_master_value()

void BendersBaseDouble::get_master_value ( )
inlineoverridevirtual

Solve and get optimal variables of the Master Problem.

Method to solve and get optimal variables of the Master Problem and update upper and lower bound

Reimplemented from BendersBase.

◆ init_data()

void BendersBaseDouble::init_data ( )
inlineoverridevirtual

Initialize set of data used in the loop.

Reimplemented from BendersBase.

◆ InitializeProblems()

void BendersBaseDouble::InitializeProblems ( )
inlineoverridevirtual

Implements BendersBase.

◆ launch()

void BendersBaseDouble::launch ( )
inlineoverridevirtual

Implements BendersBase.

◆ post_run_actions()

void BendersBaseDouble::post_run_actions ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.

◆ Run()

void BendersBaseDouble::Run ( )
inlineoverridevirtual

Implements BendersBase.

◆ SaveCurrentBendersData()

void BendersBaseDouble::SaveCurrentBendersData ( )
inlineoverridevirtual

Reimplemented from BendersBase.

◆ shouldParallelize()

bool BendersBaseDouble::shouldParallelize ( ) const
inlinenodiscardfinalprotectedvirtual

Implements BendersBase.

◆ UpdateTrace()

void BendersBaseDouble::UpdateTrace ( )
inlineoverridevirtual

Update trace of the Benders for the current iteration.

Fonction to store the current Benders data in the trace

Reimplemented from BendersBase.

◆ write_basis()

void BendersBaseDouble::write_basis ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.


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