8#include "antares-xpansion/lpnamer/helper/ProblemGenerationLogger.h"
19 std::string _sectionName;
41 std::string sign_p,
double rhs_p)
42 : _sectionName(std::move(sectionName_p)),
43 _name(std::move(constraintName_p)),
44 _sign(std::move(sign_p)),
57 [[nodiscard]] std::string
getName()
const {
return _name; }
64 [[nodiscard]]
double getRHS()
const {
return _rhs; }
72 [[nodiscard]] std::string
getSign()
const {
return _sign; }
80 void setCoeff(
const std::string& varName_p,
const double varCoeff_p) {
81 (*this)[varName_p] = varCoeff_p;
93 :
public std::map<std::string, AdditionalConstraint> {
96 std::map<std::string, std::string> _variablesToBinarise;
97 std::set<std::string> _binaryVariables;
98 std::string constraintsFilePath_;
99 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger_;
106 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger)
107 : logger_(std::move(logger)) {}
116 std::string constraints_file_path,
117 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger);
119 void SetConstraintsFile(std::string
const& constraints_file_path) {
120 constraintsFilePath_ = constraints_file_path;
122 void ReadConstraintsFile();
134 const std::string& binVarName_p);
147 std::map<std::string, std::string>
const& variables_section);
156 [[nodiscard]] std::map<std::string, std::string>
const&
166 const std::string& sectionName_l,
167 const std::map<std::string, std::string>& constarintsSection_l);
177 const std::string& sectionName_l,
178 const std::map<std::string, std::string>& constarintsSection_l)
const;
188 const std::string& sectionName_l,
189 const std::map<std::string, std::string>& constarintsSection_l)
const;
198 const std::string& sectionName_l,
199 const std::map<std::string, std::string>& constarintsSection_l)
const;
additional constraint to add to master problem
Definition AdditionalConstraints.h:17
std::string getSign() const
AdditionalConstraint::_sign getter.
Definition AdditionalConstraints.h:72
virtual ~AdditionalConstraint()=default
AdditionalConstraint destructor.
AdditionalConstraint()=default
AdditionalConstraint default constructor.
double getRHS() const
AdditionalConstraint::_rhs getter.
Definition AdditionalConstraints.h:64
void setCoeff(const std::string &varName_p, const double varCoeff_p)
adds a term to the constraint
Definition AdditionalConstraints.h:80
std::string getName() const
AdditionalConstraint::_name getter.
Definition AdditionalConstraints.h:57
AdditionalConstraint(std::string sectionName_p, std::string constraintName_p, std::string sign_p, double rhs_p)
AdditionalConstraint constructor.
Definition AdditionalConstraints.h:40
candidate exclusion constraint structure
Definition AdditionalConstraints.h:93
void constructAdditionalConstraints(const std::string §ionName_l, const std::map< std::string, std::string > &constarintsSection_l)
the method is responsible for creating and filling constraints
Definition AdditionalConstraints.cpp:56
std::string checkAndReturnConstraintName(const std::string §ionName_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
Definition AdditionalConstraints.cpp:107
std::string checkAndReturnSectionSign(const std::string §ionName_l, const std::map< std::string, std::string > &constarintsSection_l) const
the method is responsible for checking that section has defined a sign
Definition AdditionalConstraints.cpp:130
std::map< std::string, std::string > const & getVariablesToBinarise() const
getter for AdditionalConstraints::_variablesToBinarise
Definition AdditionalConstraints.cpp:52
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
Definition AdditionalConstraints.cpp:44
double checkAndReturnSectionRhs(const std::string §ionName_l, const std::map< std::string, std::string > &constarintsSection_l) const
the method is responsible for checking that section has defined a rhs
Definition AdditionalConstraints.cpp:148
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
Definition AdditionalConstraints.cpp:34
AdditionalConstraints(std::shared_ptr< ProblemGenerationLog::ProblemGenerationLogger > logger)
default constructor for struct AdditionalConstraints
Definition AdditionalConstraints.h:105