diff --git a/src/solver/optimisation/constraints/POutBounds.cpp b/src/solver/optimisation/constraints/POutBounds.cpp index c99d25543d..ab57356a83 100644 --- a/src/solver/optimisation/constraints/POutBounds.cpp +++ b/src/solver/optimisation/constraints/POutBounds.cpp @@ -103,16 +103,20 @@ void POutBounds::add(int pays, int cluster, int pdt) return counter; }; + int nbTermsUp = countReservesParticipations( + data.areaReserves[pays].areaCapacityReservationsUp); + int nbTermsDown = countReservesParticipations( + data.areaReserves[pays].areaCapacityReservationsDown); + int nbTermsToAdd = countReservesParticipations( data.areaReserves[pays].areaCapacityReservationsUp) + countReservesParticipations( data.areaReserves[pays].areaCapacityReservationsDown); + builder.data.NbTermesContraintesPourLesReserves + += (nbTermsUp + 1) * (nbTermsUp > 0) + (nbTermsDown + 1) * (nbTermsDown > 0); - - builder.data.NbTermesContraintesPourLesReserves += 2 * (nbTermsToAdd + 1); - - builder.data.nombreDeContraintes += 2; + builder.data.nombreDeContraintes += (nbTermsUp > 0) + (nbTermsDown > 0); } } diff --git a/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp b/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp index ac1def9ff3..c1c801f204 100644 --- a/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp +++ b/src/solver/optimisation/constraints/POutCapacityThreasholds.cpp @@ -107,7 +107,7 @@ void POutCapacityThreasholds::add(int pays, int cluster, int pdt) data.areaReserves[pays].areaCapacityReservationsDown); builder.data.NbTermesContraintesPourLesReserves - += (nbTermsUp + 1) * (nbTermsUp > 0) + (nbTermsDown + 1) * (nbTermsDown > 0); + += (nbTermsUp + 2) * (nbTermsUp > 0) + (nbTermsDown + 2) * (nbTermsDown > 0); builder.data.nombreDeContraintes += (nbTermsUp > 0) + (nbTermsDown > 0); } diff --git a/src/solver/optimisation/opt_rename_problem.cpp b/src/solver/optimisation/opt_rename_problem.cpp index f11aa9098b..d541c9c0ef 100644 --- a/src/solver/optimisation/opt_rename_problem.cpp +++ b/src/solver/optimisation/opt_rename_problem.cpp @@ -279,8 +279,7 @@ void VariableNamer::NumberOfOffUnitsParticipatingToReserve(unsigned int variable const std::string& clusterName, const std::string& reserveName) { - SetThermalClusterReserveElementName( - variable, "NumberOfOffUnitsParticipatingToReserve", clusterName); + SetThermalClusterAndReserveElementName(variable, "NumberOfOffUnitsParticipatingToReserve", clusterName, reserveName); } void VariableNamer::NumberStoppingDispatchableUnits(unsigned int variable, diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index 7d8a3d8b6c..607c7610a1 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -248,10 +248,10 @@ void SIM_AllocationProblemePasDeTemps(PROBLEME_HEBDO& problem, study.runtime.thermalPlantTotalCount * study.runtime.capacityReservationCount, -1); problem.CorrespondanceCntNativesCntOptim[k] .NumeroDeContrainteDesContraintesDePuissanceMinDuPalier.assign( - study.runtime.thermalPlantTotalCount, 0); + study.runtime.thermalPlantTotalCount, -1); problem.CorrespondanceCntNativesCntOptim[k] .NumeroDeContrainteDesContraintesDePuissanceMaxDuPalier.assign( - study.runtime.thermalPlantTotalCount, 0); + study.runtime.thermalPlantTotalCount, -1); problem.CorrespondanceCntNativesCntOptim[k] .NumeroDeContrainteDesContraintesSTStorageClusterMaxWithdrawParticipation.assign(