Antares Xpansion
Investment simulations for Antares studies
|
Class daughter of Worker Class, build and manage a subproblem. More...
#include <SubproblemWorker.h>
Public Member Functions | |
SubproblemWorker (VariableMap const &variable_map, const std::filesystem::path &path_to_mps, double const &slave_weight, const std::string &solver_name, const int log_level, SolverLogManager &solver_log_manager, Logger logger, ProblemsFormat format) | |
Constructor of a Worker Slave. | |
void | get_solution (std::vector< double > &solution) const |
Return the solutions values of a problem. | |
void | fix_to (Point const &x0) const |
Fix a set of variables to constant in a problem. | |
void | get_subgradient (Point &s) const |
Get LP solution value of a problem. | |
Worker (VariableMap variable_map, std::filesystem::path path_to_mps, Logger logger) | |
Public Member Functions inherited from Worker | |
Worker (VariableMap variable_map, std::filesystem::path path_to_mps, Logger logger) | |
void | init (const std::string &solver_name, int log_level, SolverLogManager &solver_log_manager, ProblemsFormat format) |
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< SolverAbstract > | solver () const |
void | solve (int &lp_status, const std::string &outputroot, const std::string &output_master_mps_file_name, Writer 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 (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 |
int | Getnrows () const |
Returns the number of rows (constraints) | |
int | Getncols () const |
Additional Inherited Members | |
Public Attributes inherited from Worker | |
std::filesystem::path | _path_to_mps |
VariableMap | _name_to_id |
Int2Str | _id_to_name |
std::shared_ptr< SolverAbstract > | _solver |
bool | _is_master = false |
Logger | logger_ |
Class daughter of Worker Class, build and manage a subproblem.
Class daughter of Worker Class, build and manage a master problem.
SubproblemWorker::SubproblemWorker | ( | VariableMap const & | variable_map, |
const std::filesystem::path & | path_to_mps, | ||
double const & | slave_weight, | ||
const std::string & | solver_name, | ||
const int | log_level, | ||
SolverLogManager & | solver_log_manager, | ||
Logger | logger, | ||
ProblemsFormat | format ) |
Constructor of a Worker Slave.
variable_map | : Map of linking each variable of the problem to its id |
problem_name | : Name of the problem |
void SubproblemWorker::fix_to | ( | Point const & | x0 | ) | const |
Fix a set of variables to constant in a problem.
Method to set variables in a problem by fixing their bounds
x0 | : Set of variables to fix |
void SubproblemWorker::get_solution | ( | std::vector< double > & | solution | ) | const |
Return the solutions values of a problem.
lb | : reference to a map |
void SubproblemWorker::get_subgradient | ( | Point & | s | ) | const |
Get LP solution value of a problem.
s | : Empty point which receives the solution |