Skip to content

Commit

Permalink
Simplify, add const qualifier
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Sep 25, 2023
1 parent 4703653 commit d70e160
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/solver/hydro/monthly/h2o_m_ajouter_bruit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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<std::vector<int>*> monthlyVariables
const std::vector<const std::vector<int>*> monthlyVariables
= {&CorrespondanceDesVariables.NumeroDeVariableVolume,
&CorrespondanceDesVariables.NumeroDeVariableTurbine,
&CorrespondanceDesVariables.NumeroDeVariableDepassementVolumeMax,
Expand All @@ -32,9 +32,8 @@ void H2O_M_AjouterBruitAuCout(DONNEES_ANNUELLES& DonneesAnnuelles)

for (const auto& variable : monthlyVariables)
{
for (const auto& v : *variable)
for (int Var : *variable)
{
int Var = v;
CoutLineaireBruite[Var]
= CoutLineaire[Var] + noiseGenerator() * Constants::noiseAmplitude;
}
Expand Down

0 comments on commit d70e160

Please sign in to comment.