Skip to content

Commit

Permalink
fix bug occuring when not all the thermal clusters are participating …
Browse files Browse the repository at this point in the history
…to a reserve
  • Loading branch information
bencamus committed Nov 6, 2024
1 parent 6613609 commit 92d7ad1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
12 changes: 8 additions & 4 deletions src/solver/optimisation/constraints/POutBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/solver/optimisation/opt_rename_problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/solver/simulation/sim_alloc_probleme_hebdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 92d7ad1

Please sign in to comment.