Skip to content

Commit

Permalink
Fix monthlyVariables
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Sep 25, 2023
1 parent e47373b commit bbe7c31
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/solver/hydro/monthly/h2o_m_ajouter_bruit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ void H2O_M_AjouterBruitAuCout(DONNEES_ANNUELLES& DonneesAnnuelles)
Antares::MersenneTwister noiseGenerator;
noiseGenerator.reset(Constants::seed); // Arbitrary seed, hard-coded since we don't really want
// the user to change it
const std::vector<int*>& monthlyVariables
= {CorrespondanceDesVariables.NumeroDeVariableVolume.data(),
CorrespondanceDesVariables.NumeroDeVariableTurbine.data(),
CorrespondanceDesVariables.NumeroDeVariableDepassementVolumeMax.data(),
CorrespondanceDesVariables.NumeroDeVariableDepassementVolumeMin.data(),
CorrespondanceDesVariables.NumeroDeVariableDEcartPositifAuTurbineCible.data(),
CorrespondanceDesVariables.NumeroDeVariableDEcartNegatifAuTurbineCible.data()};
const std::vector<std::vector<int>*> monthlyVariables
= {&CorrespondanceDesVariables.NumeroDeVariableVolume,
&CorrespondanceDesVariables.NumeroDeVariableTurbine,
&CorrespondanceDesVariables.NumeroDeVariableDepassementVolumeMax,
&CorrespondanceDesVariables.NumeroDeVariableDepassementVolumeMin,
&CorrespondanceDesVariables.NumeroDeVariableDEcartPositifAuTurbineCible,
&CorrespondanceDesVariables.NumeroDeVariableDEcartNegatifAuTurbineCible};

for (const auto variable : monthlyVariables)
{
for (int Pdt = 0; Pdt < DonneesAnnuelles.NombreDePasDeTemps; Pdt++)
{
int Var = variable[Pdt];
int Var = (*variable)[Pdt];
CoutLineaireBruite[Var]
= CoutLineaire[Var] + noiseGenerator() * Constants::noiseAmplitude;
}
Expand Down

0 comments on commit bbe7c31

Please sign in to comment.