|
Antares Xpansion
Investment simulations for Antares studies
|
Public Member Functions | |
| WorkerMaster (const VariableMap &variable_map, const std::string &solver_name, int log_level, int subproblems_count, SolverLogManager &solver_log_manager, bool mps_has_alpha, Logger logger, ProblemsFormat format, IBendersProblemProvider *benders_problem_provider, double master_solution_tolerance, double cut_coefficient_tolerance) | |
| Constructor of a Master Problem. | |
| void | get (Point &x0, double &overall_subpb_cost_under_approx, DblVector &single_subpb_costs_under_approx) |
| Return optimal variables of a problem. | |
| void | get_dual_values (std::vector< double > &dual) const |
| Set dual values of a problem in a vector. | |
| int | get_number_constraint () const |
| Return number of constraint in a problem. | |
| void | add_cut (const Point &s, const Point &x0, const double &rhs) const |
| Add benders cut to a problem. | |
| void | add_cut_by_iter (int i, const Point &s, const double &sx0, const double &rhs) const |
| Add benders cut to a problem. | |
| void | add_dynamic_cut (const Point &s, const double &sx0, const double &rhs) const |
| Add benders cut to a problem. | |
| void | addSubproblemCut (int i, const Point &subgradient, const Point &x0, const double &rhs) const |
| Add one benders cut to a problem. | |
| void | fix_alpha (const double &bestUB) const |
| Fix an upper bound and the variable overall_subpb_cost_under_approx of a problem. | |
| virtual void | DeactivateIntegrityConstraints () const |
| virtual void | ActivateIntegrityConstraints () const |
| virtual std::vector< int > | get_id_int_vars () const |
| void | set_id_alpha (double id_alpha) |
| void | set_id_single_subpb_costs_under_approx (std::vector< int > id_single_subpb_costs_under_approx) |
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 |
| WorkerMaster::WorkerMaster | ( | const VariableMap & | variable_map, |
| const std::string & | solver_name, | ||
| int | log_level, | ||
| int | subproblems_count, | ||
| SolverLogManager & | solver_log_manager, | ||
| bool | mps_has_alpha, | ||
| Logger | logger, | ||
| ProblemsFormat | format, | ||
| IBendersProblemProvider * | benders_problem_provider, | ||
| double | master_solution_tolerance, | ||
| double | cut_coefficient_tolerance ) |
Constructor of a Master Problem.
Construct a Master Problem by loading mps and mapping files and adding the variable overall_subpb_cost_under_approx
| variable_map | : map linking each variable to its id in the problem |
| path_to_mps | : path to the problem mps file |
| solver_name | : solver name |
| log_level | : solver log level |
| subproblems_count | : number of subproblems |
| void WorkerMaster::add_cut | ( | const Point & | s, |
| const Point & | x_cut, | ||
| const double & | rhs ) const |
Add benders cut to a problem.
| s | : subgradient of optimal slave variables |
| x_cut | : master separation point |
| rhs | : optimal slave value |
| void WorkerMaster::add_cut_by_iter | ( | int | i, |
| const Point & | s, | ||
| const double & | sx0, | ||
| const double & | rhs ) const |
Add benders cut to a problem.
| i | : identifier of a subproblem |
| s | : optimal slave variables |
| sx0 | : subgradient times x0 |
| rhs | : optimal slave value |
| void WorkerMaster::add_dynamic_cut | ( | const Point & | s, |
| const double & | sx0, | ||
| const double & | rhs ) const |
Add benders cut to a problem.
| s | : optimal slave variables |
| sx0 | : subgradient times x0 |
| rhs | : optimal slave value |
| void WorkerMaster::addSubproblemCut | ( | int | i, |
| const Point & | subgradient, | ||
| const Point & | x_cut, | ||
| const double & | rhs ) const |
Add one benders cut to a problem.
| i | : identifier of a subproblem |
| s | : optimal slave variables |
| x_cut | : optimal Master variables |
| rhs | : optimal slave value |
| void WorkerMaster::fix_alpha | ( | const double & | bestUB | ) | const |
Fix an upper bound and the variable overall_subpb_cost_under_approx of a problem.
| bestUB | : bound to fix |
| void WorkerMaster::get | ( | Point & | x_out, |
| double & | overall_subpb_cost_under_approx, | ||
| DblVector & | single_subpb_costs_under_approx ) |
Return optimal variables of a problem.
Set optimal variables of a problem which has the form (min(x,overall_subpb_cost_under_approx) : f(x) + overall_subpb_cost_under_approx)
| x_out | : reference to an empty map list |
| overall_subpb_cost_under_approx | : reference to an empty double |
| void WorkerMaster::get_dual_values | ( | std::vector< double > & | dual | ) | const |
Set dual values of a problem in a vector.
| dual | : reference to a vector of double |