diff --git a/src/solver/optimisation/constraint_builder.cpp b/src/solver/optimisation/constraint_builder.cpp index 4f55dbf73a..122c06296e 100644 --- a/src/solver/optimisation/constraint_builder.cpp +++ b/src/solver/optimisation/constraint_builder.cpp @@ -264,46 +264,3 @@ ConstraintBuilder& ConstraintBuilder::LayerStorage(unsigned area, AddVariable(GetVariableManager(shift, wrap, delta).LayerStorage(area, layer), coeff); return *this; } - -int ConstraintBuilder::getVariableIndex(const Variable::Variables& variable, - int shift, - bool wrap, - int delta) const -{ - int pdt = hourInWeek_ + shift; - const int nbTimeSteps = problemeHebdo.NombreDePasDeTempsPourUneOptimisation; - - if (wrap) - { - if (shift >= 0) - { - pdt = pdt % nbTimeSteps; - } - else - { - pdt = (pdt + delta) % nbTimeSteps; - } - } - const Variable::ConstraintVisitor visitor(varNative[pdt], - problemeHebdo.NumeroDeVariableStockFinal, - problemeHebdo.NumeroDeVariableDeTrancheDeStock); - return std::visit(visitor, variable); -} - -ConstraintBuilder& ConstraintBuilder::include(Variable::Variables var, - double coeff, - int shift, - bool wrap, - int delta) -{ - std::vector& Pi = problemeAResoudre.Pi; - std::vector& Colonne = problemeAResoudre.Colonne; - int varIndex = getVariableIndex(var, shift, wrap, delta); - if (varIndex >= 0) - { - Pi[nombreDeTermes_] = coeff; - Colonne[nombreDeTermes_] = varIndex; - nombreDeTermes_++; - } - return *this; -} diff --git a/src/solver/optimisation/constraint_builder.h b/src/solver/optimisation/constraint_builder.h index b15c0379de..49fe34915d 100644 --- a/src/solver/optimisation/constraint_builder.h +++ b/src/solver/optimisation/constraint_builder.h @@ -175,19 +175,7 @@ class ConstraintBuilder return *this; } -private: - int getVariableIndex(const Variable::Variables& variable, - int shift, - bool wrap, - int delta) const; - public: - ConstraintBuilder& include(Variable::Variables var, - double coeff, - int shift = 0, - bool wrap = false, - int delta = 0); - ConstraintBuilder& DispatchableProduction(unsigned int index, double coeff, int shift = 0,