Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
SubproblemWorker Class Reference

Class daughter of Worker Class, build and manage a subproblem. More...

#include <SubproblemWorker.h>

Inheritance diagram for SubproblemWorker:
Worker

Public Member Functions

 SubproblemWorker (const VariableMap &variable_map, double slave_weight, const std::string &solver_name, int log_level, const SolverLogManager &solver_log_manager, Logger logger, ProblemsFormat format, IBendersProblemProvider *benders_problem_provider, double cut_coefficient_tolerance)
 Constructor of a Worker Slave.
 
std::vector< double > get_solution () const
 Return the solutions values of a problem.
 
void fix_to (const Point &x0) const
 Fix a set of variables to constant in a problem.
 
void get_subgradient (Point &subgradient) const
 Get LP solution value of a problem.
 
 Worker (VariableMap variable_map, Logger logger, double cut_coefficient_tolerance)
 
- Public Member Functions inherited from Worker
 Worker (VariableMap variable_map, Logger logger, double cut_coefficient_tolerance)
 
void init (const std::string &solver_name, int log_level, const SolverLogManager &solver_log_manager, ProblemsFormat format, IBendersProblemProvider *benders_problem_provider)
 Initialization of a problem.
 
void get_value (double &lb) const
 Return the optimal value of a problem.
 
void get_splex_num_of_ite_last (int &result) const
 Get the number of iteration needed to solve a problem.
 
void free ()
 Free the problem.
 
void write_basis (const std::filesystem::path &filename) const
 
virtual std::shared_ptr< SolverAbstractsolver () const
 
void solve (int &lp_status, const std::string &outputroot, const std::string &output_master_mps_file_name, std::shared_ptr< Output::OutputWriter > writer) const
 Method to solve a problem.
 
int RowIndex (const std::string &row_name) const
 
void ChangeRhs (int id_row, double val) const
 
void GetRhs (double *val, int id_row) const
 
void AddRows (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
 
int Getnrows () const
 Returns the number of rows (constraints)
 
int Getncols () const
 

Additional Inherited Members

- Public Attributes inherited from Worker
std::filesystem::path _base_filename
 
VariableMap _name_to_id
 
Int2Str _id_to_name
 
std::shared_ptr< SolverAbstract_solver = nullptr
 
bool _is_master = false
 
Logger logger_
 
- Protected Member Functions inherited from Worker
void roundIfWithinTolerance (std::vector< double > &values, int first, int last) const
 

Detailed Description

Class daughter of Worker Class, build and manage a subproblem.

Class daughter of Worker Class, build and manage a master problem.

Constructor & Destructor Documentation

◆ SubproblemWorker()

SubproblemWorker::SubproblemWorker ( const VariableMap & variable_map,
double slave_weight,
const std::string & solver_name,
int log_level,
const SolverLogManager & solver_log_manager,
Logger logger,
ProblemsFormat format,
IBendersProblemProvider * benders_problem_provider,
double cut_coefficient_tolerance )

Constructor of a Worker Slave.

Parameters
variable_map: Map of linking each variable of the problem to its id
problem_name: Name of the problem

Member Function Documentation

◆ fix_to()

void SubproblemWorker::fix_to ( const Point & x0) const

Fix a set of variables to constant in a problem.

Method to set variables in a problem by fixing their bounds

Parameters
x0: Set of variables to fix

◆ get_solution()

std::vector< double > SubproblemWorker::get_solution ( ) const

Return the solutions values of a problem.

Parameters
lb: reference to a map

◆ get_subgradient()

void SubproblemWorker::get_subgradient ( Point & subgradient) const

Get LP solution value of a problem.

Parameters
s: Empty point which receives the solution

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