Skip to content

Commit

Permalink
Include overflow variable in HydroPower constraint (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes authored Feb 2, 2024
1 parent 6555fcb commit 0109f96
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/solver/optimisation/constraints/HydroPower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ void HydroPower::add(int pays)
{
const int NombreDePasDeTempsPourUneOptimisation
= builder.data.NombreDePasDeTempsPourUneOptimisation;
auto caracteristiquesHydrauliques = data.CaracteristiquesHydrauliques[pays];
const auto& caracteristiquesHydrauliques = data.CaracteristiquesHydrauliques[pays];
if (caracteristiquesHydrauliques.PresenceDHydrauliqueModulable
&& !caracteristiquesHydrauliques.TurbinageEntreBornes)
{
Expand All @@ -15,14 +15,21 @@ void HydroPower::add(int pays)
const double pumpingRatio = caracteristiquesHydrauliques.PumpingRatio;
for (int pdt = 0; pdt < NombreDePasDeTempsPourUneOptimisation; pdt++)
{
builder.updateHourWithinWeek(pdt).HydProd(pays, 1.0).Pumping(pays, -pumpingRatio);
builder
.updateHourWithinWeek(pdt)
.HydProd(pays, 1.0)
.Pumping(pays, -pumpingRatio)
.Overflow(pays, 1.0);
}
}
else
{
for (int pdt = 0; pdt < NombreDePasDeTempsPourUneOptimisation; pdt++)
{
builder.updateHourWithinWeek(pdt).HydProd(pays, 1.0);
builder
.updateHourWithinWeek(pdt)
.HydProd(pays, 1.0)
.Overflow(pays, 1.0);
}
}
data.NumeroDeContrainteEnergieHydraulique[pays] = builder.data.nombreDeContraintes;
Expand Down

0 comments on commit 0109f96

Please sign in to comment.