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

Mother-class Worker. More...

#include <Worker.h>

Inheritance diagram for Worker:
SubproblemWorker WorkerMaster FakeWorkerMaster

Public Member Functions

 Worker (Logger logger)
 
void init (VariableMap const &variable_map, const std::filesystem::path &path_to_mps, std::string const &solver_name, int log_level, SolverLogManager &solver_log_manager)
 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 SolverAbstract::Ptr 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
 

Public Attributes

std::filesystem::path _path_to_mps
 
VariableMap _name_to_id
 
Int2Str _id_to_name
 
SolverAbstract::Ptr _solver
 
bool _is_master = false
 
Logger logger_
 

Detailed Description

Mother-class Worker.

This class opens and sets a problem from a mps and a mapping variable map

Member Function Documentation

◆ get_splex_num_of_ite_last()

void Worker::get_splex_num_of_ite_last ( int &  result) const

Get the number of iteration needed to solve a problem.

Parameters
result: result

◆ get_value()

void Worker::get_value ( double &  lb) const

Return the optimal value of a problem.

Parameters
lb: double which receives the optimal value

◆ Getnrows()

int Worker::Getnrows ( ) const

Returns the number of rows (constraints)

Parameters
solver_p: solver containing the model to consider.

◆ init()

void Worker::init ( VariableMap const &  variable_map,
const std::filesystem::path &  path_to_mps,
std::string const &  solver_name,
int  log_level,
SolverLogManager solver_log_manager 
)

Initialization of a problem.

Parameters
variable_map: map linking each problem name to its variables and their ids
problem_name: name of the problem

◆ solve()

void Worker::solve ( int &  lp_status,
const std::string &  outputroot,
const std::string &  output_master_mps_file_name,
Writer  writer 
) const

Method to solve a problem.

Parameters
lp_status: problem status after optimization

Member Data Documentation

◆ _id_to_name

Int2Str Worker::_id_to_name

Link between the identifier of a variable and its name

◆ _name_to_id

VariableMap Worker::_name_to_id

Link between the variable name and its identifier

◆ _solver

SolverAbstract::Ptr Worker::_solver
Initial value:
=
nullptr

Problem stocked in the instance Worker


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