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

Public Member Functions

 BendersSequentialDouble (BendersBaseOptions const &options, Logger &logger, Writer writer, std::shared_ptr< MathLoggerDriver > mathLoggerDriver)
 
void init_data () override
 Initialize set of data used in the loop.
 
WorkerMasterPtr get_master () const
 
void get_master_value () override
 Solve and get optimal variables of the Master Problem.
 
void BuildCut () override
 Build subproblem cut and store it in the BendersSequential trace.
 
void compute_ub () override
 
CurrentIterationData get_data () const
 
void write_basis () const override
 
void EndWritingInOutputFile () const override
 
void UpdateTrace () override
 Update trace of the Benders for the current iteration.
 
void post_run_actions () const override
 
void SaveCurrentBendersData () override
 
void reset_master (WorkerMaster *worker_master) override
 
void free () override
 Method to free the memory used by each problem.
 
void InitializeProblems () override
 
void DeactivateIntegrityConstraints () const override
 
void ActivateIntegrityConstraints () const override
 
void SetDataPreRelaxation () override
 
void ResetDataPostRelaxation () override
 
void set_data (bool stop, int nsubproblem)
 
void set_bounds (double lb, double best_ub)
 
void set_bestx (Point x_out, Point x_in)
 
void set_ub (double ub)
 
void set_it (int it)
 
- Public Member Functions inherited from BendersSequential
 BendersSequential (BendersBaseOptions const &options, Logger logger, Writer writer, std::shared_ptr< MathLoggerDriver > mathLoggerDriver)
 Constructor of class BendersSequential.
 
virtual void launch ()
 
std::string BendersName () const
 
- Public Member Functions inherited from BendersBase
 BendersBase (BendersBaseOptions options, Logger logger, Writer writer, std::shared_ptr< MathLoggerDriver > mathLoggerDriver)
 
void set_solver_log_file (const std::filesystem::path &log_file)
 
std::filesystem::path solver_log_file () const
 
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 (std::vector< char > const &qrtype_p, std::vector< double > const &rhs_p, std::vector< double > const &range_p, std::vector< int > const &mstart_p, std::vector< int > const &mclind_p, std::vector< double > const &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
 Get path to last mps file of master problem.
 
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
 
void ResetData (double criterion)
 
void InitExternalValues ()
 
int GetBendersRunNumber () const
 
CurrentIterationData GetCurrentIterationData () const
 

Public Attributes

bool parametrized_stop = false
 
int parametrized_it = 0
 
int parametrized_nsubproblem = 0
 
double parametrized_lb = -1e20
 
double parametrized_ub = +1e20
 
double parametrized_best_ub = +1e20
 
bool _deactivateIntConstraintCall = false
 
bool _reactivateIntConstraintCall = false
 
bool _setDataPreRelaxationCall = false
 
bool _setDataPostRelaxationCall = false
 
- Public Attributes inherited from BendersBase
Logger _logger
 
Writer _writer
 
std::shared_ptr< MathLoggerDrivermathLoggerDriver_
 

Additional Inherited Members

- Protected Member Functions inherited from BendersSequential
virtual void Run ()
 Run BendersSequential algorithm.
 
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 ComputeXCut ()
 
void ComputeInvestCost ()
 
void GetSubproblemCut (SubProblemDataMap &subproblem_data_map)
 Solve and store optimal variables of all Subproblem Problems.
 
void BuildCutFull (const SubProblemDataMap &subproblem_data_map)
 Add cuts in master problem.
 
std::filesystem::path GetSubproblemPath (std::string const &subproblem_name) const
 Get path to subproblem mps file from options.
 
double SubproblemWeight (int subproblem_count, std::string const &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
 Get path to structure txt file from options.
 
LogData bendersDataToLogData (const CurrentIterationData &data) const
 
void free_master ()
 
void free_subproblems ()
 
void AddSubproblem (const std::pair< std::string, VariableMap > &kvp)
 
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 get_timer_master () const
 
void set_timer_master (const double &timer_master)
 
double GetSubproblemsWalltime () const
 
void SetSubproblemsWalltime (const double &duration)
 
double GetSubproblemsCpuTime () const
 
void SetSubproblemsCpuTime (const double &duration)
 
double GetSubproblemsCumulativeCpuTime () const
 
void SetSubproblemsCumulativeCpuTime (const double &duration)
 
double GetSubproblemCost () const
 
void SetSubproblemCost (const double &subproblem_cost)
 
bool IsResumeMode () const
 
std::filesystem::path LastIterationFile () const
 
void UpdateMaxNumberIterationResumeMode (const unsigned 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)
 Update maximum and minimum of simplex iterations.
 
void ResetSimplexIterationsBounds ()
 
- Protected Attributes inherited from BendersBase
CurrentIterationData _data
 
WorkerMasterDataVect workerMasterDataVect_
 
VariableMap master_variable_map_
 
CouplingMap coupling_map_
 
bool init_data_ = true
 
bool init_problems_ = true
 
bool free_problems_ = true
 
SolverLogManager solver_log_manager_
 

Member Function Documentation

◆ ActivateIntegrityConstraints()

void BendersSequentialDouble::ActivateIntegrityConstraints ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.

◆ BuildCut()

void BendersSequentialDouble::BuildCut ( )
inlineoverridevirtual

Build subproblem cut and store it in the BendersSequential trace.

Method to build subproblem cuts, store them in the BendersSequential trace and add them to the Master problem

Reimplemented from BendersSequential.

◆ compute_ub()

void BendersSequentialDouble::compute_ub ( )
inlineoverridevirtual

Reimplemented from BendersBase.

◆ DeactivateIntegrityConstraints()

void BendersSequentialDouble::DeactivateIntegrityConstraints ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.

◆ EndWritingInOutputFile()

void BendersSequentialDouble::EndWritingInOutputFile ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.

◆ free()

void BendersSequentialDouble::free ( )
inlineoverridevirtual

Method to free the memory used by each problem.

Reimplemented from BendersSequential.

◆ get_master_value()

void BendersSequentialDouble::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 BendersSequentialDouble::init_data ( )
inlineoverridevirtual

Initialize set of data used in the loop.

Reimplemented from BendersBase.

◆ InitializeProblems()

void BendersSequentialDouble::InitializeProblems ( )
inlineoverridevirtual

Reimplemented from BendersSequential.

◆ post_run_actions()

void BendersSequentialDouble::post_run_actions ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.

◆ reset_master()

void BendersSequentialDouble::reset_master ( WorkerMaster worker_master)
inlineoverridevirtual

Reimplemented from BendersBase.

◆ ResetDataPostRelaxation()

void BendersSequentialDouble::ResetDataPostRelaxation ( )
inlineoverridevirtual

Reimplemented from BendersBase.

◆ SaveCurrentBendersData()

void BendersSequentialDouble::SaveCurrentBendersData ( )
inlineoverridevirtual

Reimplemented from BendersBase.

◆ SetDataPreRelaxation()

void BendersSequentialDouble::SetDataPreRelaxation ( )
inlineoverridevirtual

Reimplemented from BendersBase.

◆ UpdateTrace()

void BendersSequentialDouble::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 BendersSequentialDouble::write_basis ( ) const
inlineoverridevirtual

Reimplemented from BendersBase.


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