Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
AbstractMergeMPS Class Referenceabstract
Inheritance diagram for AbstractMergeMPS:
MergeMasterSubproblemMPS MergeMasterTrajectoryMPS

Public Member Functions

 AbstractMergeMPS (MergeMPSOptions options, Logger logger, std::shared_ptr< Output::OutputWriter > writer)
 
virtual void launch ()=0
 

Protected Member Functions

void terminate (const std::string &location, const std::string &message) const
 Interrupt the program and output current merged .lp and .mps files.
 
void export_problem (const std::string &filename="log_merged", bool export_lp=false) const
 Export problem into INPUTROOT/filename and optionally writes the lp variant We do it this way because we cannot read a master problem not at the input root.
 
std::shared_ptr< SolverAbstractget_local_solver (const std::filesystem::path &root_dir, const std::string &filename) const
 Creates a local solver from a MPS file.
 
void multiply_obj_by_weight_factor (SolverAbstract &local_solver, double weight) const
 Weights local solver's objective function by a given value.
 
VariableMap merge_local_solver (SolverAbstract &local_solver, const std::string &local_prefix, const VariableMap &local_var_map, const std::string &filename) const
 Merges local to global solver.
 

Protected Attributes

std::shared_ptr< Output::OutputWriterwriter_
 
MergeMPSOptions options_
 
Logger logger_
 
const SolverFactory factory_
 
SolverIO solver_io_
 
std::shared_ptr< SolverAbstractptr_merged_solver_
 

Member Function Documentation

◆ get_local_solver()

std::shared_ptr< SolverAbstract > AbstractMergeMPS::get_local_solver ( const std::filesystem::path & root_dir,
const std::string & filename ) const
nodiscardprotected

Creates a local solver from a MPS file.

Parameters
root_dir: Directory of MPS file
filename: MPS file name

Limitation: on windows may not support master problem with full path as name

◆ launch()

virtual void AbstractMergeMPS::launch ( )
pure virtual

◆ merge_local_solver()

VariableMap AbstractMergeMPS::merge_local_solver ( SolverAbstract & local_solver,
const std::string & local_prefix,
const VariableMap & local_var_map,
const std::string & filename ) const
protected

Merges local to global solver.

Parameters
local_solver: Local solver
local_prefix: Local solver's prefix
local_var_map: Local solver's variable mapping
filename: MPS file name

◆ multiply_obj_by_weight_factor()

void AbstractMergeMPS::multiply_obj_by_weight_factor ( SolverAbstract & local_solver,
double weight ) const
protected

Weights local solver's objective function by a given value.

Parameters
local_solver: Subproblem solver that will be modified
weight: Factor to apply

◆ terminate()

void AbstractMergeMPS::terminate ( const std::string & location,
const std::string & message ) const
protected

Interrupt the program and output current merged .lp and .mps files.

Parameters
message: Error message to be output

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