Skip to content

Commit

Permalink
Make computation of intermediate values more readable (#2005)
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes authored Mar 22, 2024
1 parent 06fce45 commit 802ddb9
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/solver/optimisation/opt_restaurer_les_donnees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ void OPT_RestaurerLesDonnees(PROBLEME_HEBDO* problemeHebdo)
if (!CaracteristiquesHydrauliques.PresenceDHydrauliqueModulable)
continue;

CaracteristiquesHydrauliques.ContrainteDePmaxHydrauliqueHoraire[pdt]
double& hourlyPmax = CaracteristiquesHydrauliques.ContrainteDePmaxHydrauliqueHoraire[pdt];
hourlyPmax
= CaracteristiquesHydrauliques.ContrainteDePmaxHydrauliqueHoraireRef[pdt];
if (CaracteristiquesHydrauliques.SansHeuristique)
continue;
Expand All @@ -73,18 +74,11 @@ void OPT_RestaurerLesDonnees(PROBLEME_HEBDO* problemeHebdo)
double PmaxHydUplift
= CaracteristiquesHydrauliques.ContrainteDePmaxPompageHoraire[pdt];
PmaxHydUplift *= problemeHebdo->CoefficientEcretementPMaxHydraulique[pays];

if (PmaxHydEcretee < PmaxHydUplift)
PmaxHydEcretee = PmaxHydUplift;
PmaxHydEcretee = std::max(PmaxHydUplift, PmaxHydEcretee);
}

// The generating power allowance cannot exceed the maximum available generating power
if (PmaxHydEcretee
< CaracteristiquesHydrauliques.ContrainteDePmaxHydrauliqueHoraire[pdt])
{
CaracteristiquesHydrauliques.ContrainteDePmaxHydrauliqueHoraire[pdt]
= PmaxHydEcretee;
}
hourlyPmax = std::min(PmaxHydEcretee, hourlyPmax);
}
}

Expand Down

0 comments on commit 802ddb9

Please sign in to comment.