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

Static Public Member Functions

static CouplingMap BuildInput (const std::filesystem::path &structure_path, ILoggerXpansion *logger, const std::string &context="Benders")
 Build the input from the structure file.
 
static void BuildSubProblemConstraintMap (const CouplingMap &coupling_map, SubProblemConstraintMap &subproblem_constraint_map, CouplingMap &constraints_coupling_map, const SimulationOptions &options)
 Build maps from subproblem names to their constraint files Warning : this is heavily dependent on the coupling_map input file format.
 

Member Function Documentation

◆ BuildInput()

CouplingMap CouplingMapGenerator::BuildInput ( const std::filesystem::path & structure_path,
ILoggerXpansion * logger,
const std::string & context = "Benders" )
static

Build the input from the structure file.

Function to build the map linking each problem name to its variables and their id

Parameters
root: root of the structure file
summary_name: name of the structure file
coupling_map: empty map to increment
Note
The id in the coupling_map is that of the variable in the solver responsible for the creation of the structure file.

◆ BuildSubProblemConstraintMap()

void CouplingMapGenerator::BuildSubProblemConstraintMap ( const CouplingMap & coupling_map,
SubProblemConstraintMap & subproblem_constraint_map,
CouplingMap & constraints_coupling_map,
const SimulationOptions & options )
static

Build maps from subproblem names to their constraint files Warning : this is heavily dependent on the coupling_map input file format.

Iterates over the coupling_map keys (subproblem names) and derives the path to each subproblem's constraint file. Entries whose extracted number equals "master" are skipped.

Expected subproblem name formats (as found in coupling_map keys):

  • MPS_FILE: "<prefix>_<num>.<ext>" e.g. "problem_0.mps" Extracts <num> between the first '' and the first '.'. Constraint path: "constraints/constraints</em><num>.<ext>"
  • Other (SVF, extension not present in the coupling_map): "<prefix>_<num>" e.g. "problem_0" Extracts <num> after the first '_'. Constraint path: "constraints/constraints_<num>.svf"

Parameters
coupling_map: map from subproblem name to variable map
subproblem_constraint_map: filled with subproblem -> constraint path
constraints_coupling_map: filled with constraint path -> variable map
options: simulation options (determines format)


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