Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
AdditionalConstraints Struct Reference

candidate exclusion constraint structure More...

#include <AdditionalConstraints.h>

Inheritance diagram for AdditionalConstraints:

Public Member Functions

 AdditionalConstraints (ProblemGenerationLog::ProblemGenerationLoggerSharedPointer logger)
 default constructor for struct AdditionalConstraints
 
 AdditionalConstraints (std::string const &constraints_file_path, ProblemGenerationLog::ProblemGenerationLoggerSharedPointer logger)
 AdditionalConstraints constructor from an ini file path.
 
void SetConstraintsFile (std::string const &constraints_file_path)
 
void ReadConstraintsFile ()
 
void addVariableToBinarise (const std::string &oldVarName_p, const std::string &binVarName_p)
 adds a binary variable to be created and links it to the corresponding variable
 
void addVariablesToBinarise (std::map< std::string, std::string > const &variables_section)
 adds a binary variable to be created and links it to the corresponding variable
 
std::map< std::string, std::string > const & getVariablesToBinarise () const
 getter for AdditionalConstraints::_variablesToBinarise
 
void constructAdditionalConstraints (const std::string &sectionName_l, const std::map< std::string, std::string > &constarintsSection_l)
 the method is responsible for creating and filling constraints
 
std::string checkAndReturnConstraintName (const std::string &sectionName_l, const std::map< std::string, std::string > &constarintsSection_l) const
 the method is responsible for checking that section has defined a unique constraint name
 
std::string checkAndReturnSectionSign (const std::string &sectionName_l, const std::map< std::string, std::string > &constarintsSection_l) const
 the method is responsible for checking that section has defined a sign
 
double checkAndReturnSectionRhs (const std::string &sectionName_l, const std::map< std::string, std::string > &constarintsSection_l) const
 the method is responsible for checking that section has defined a rhs
 

Detailed Description

candidate exclusion constraint structure

inherites from a map where keys are unique constraint names and values are the additional constraints

Constructor & Destructor Documentation

◆ AdditionalConstraints()

AdditionalConstraints::AdditionalConstraints ( std::string const &  constraints_file_path,
ProblemGenerationLog::ProblemGenerationLoggerSharedPointer  logger 
)
explicit

AdditionalConstraints constructor from an ini file path.

Parameters
constraints_file_pathString corresponding to the additional constraints file path

Member Function Documentation

◆ addVariablesToBinarise()

void AdditionalConstraints::addVariablesToBinarise ( std::map< std::string, std::string > const &  variables_section)

adds a binary variable to be created and links it to the corresponding variable

Parameters
variables_sectionstd::map<std::string, std::string> whose value is the name of the binary variables to create and whose key is the corresponding existing variable to link toe

adds entries to the AdditionalConstraints::_variablesToBinarise

◆ addVariableToBinarise()

void AdditionalConstraints::addVariableToBinarise ( const std::string &  oldVarName_p,
const std::string &  binVarName_p 
)

adds a binary variable to be created and links it to the corresponding variable

Parameters
oldVarName_pString name of the old variable
binVarName_pString name of the new binary variable to link to the old existing one

adds an entry to the AdditionalConstraints::_variablesToBinarise

◆ checkAndReturnConstraintName()

std::string AdditionalConstraints::checkAndReturnConstraintName ( const std::string &  sectionName_l,
const std::map< std::string, std::string > &  constarintsSection_l 
) const

the method is responsible for checking that section has defined a unique constraint name

Parameters
std::stringsectionName_l the section name
constarintsSection_lis a std::map<std::string, std::string> where keys are the constraints entries ("name", "sign", "rhs")
Returns
std::string the constraint name

◆ checkAndReturnSectionRhs()

double AdditionalConstraints::checkAndReturnSectionRhs ( const std::string &  sectionName_l,
const std::map< std::string, std::string > &  constarintsSection_l 
) const

the method is responsible for checking that section has defined a rhs

Parameters
std::stringsectionName_l the section name
constarintsSection_lis a std::map<std::string, std::string> where keys are the constraints entries ("name", "sign", "rhs")
Returns
std::string the rhs

◆ checkAndReturnSectionSign()

std::string AdditionalConstraints::checkAndReturnSectionSign ( const std::string &  sectionName_l,
const std::map< std::string, std::string > &  constarintsSection_l 
) const

the method is responsible for checking that section has defined a sign

Parameters
std::stringsectionName_l the section name
constarintsSection_lis a std::map<std::string, std::string> where keys are the constraints entries ("name", "sign", "rhs")
Returns
std::string the constraint sign

◆ constructAdditionalConstraints()

void AdditionalConstraints::constructAdditionalConstraints ( const std::string &  sectionName_l,
const std::map< std::string, std::string > &  constarintsSection_l 
)

the method is responsible for creating and filling constraints

Parameters
std::stringsectionName_l the section name
constarintsSection_lis a std::map<std::string, std::string> where keys are the constraints entries ("name", "sign", "rhs")

◆ getVariablesToBinarise()

std::map< std::string, std::string > const & AdditionalConstraints::getVariablesToBinarise ( ) const

getter for AdditionalConstraints::_variablesToBinarise

Returns
std::map<std::string, std::string> whose value is the name of the binary variables to create and whose key is the corresponding existing variable to link to

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