|
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 (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< SolverAbstract > | solver () 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 |
Class daughter of Worker Class, build and manage a subproblem.
Class daughter of Worker Class, build and manage a master problem.
| 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.
| variable_map | : Map of linking each variable of the problem to its id |
| problem_name | : Name of the problem |
| 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
| x0 | : Set of variables to fix |
| std::vector< double > SubproblemWorker::get_solution | ( | ) | const |
Return the solutions values of a problem.
| lb | : reference to a map |
| void SubproblemWorker::get_subgradient | ( | Point & | subgradient | ) | const |
Get LP solution value of a problem.
| s | : Empty point which receives the solution |