Skip to content

Commit

Permalink
[FIX] Remove MaxDesPmaxHydrauliquesRef
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jul 31, 2023
1 parent 9e6c0c3 commit ced1287
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ void OPT_MaxDesPmaxHydrauliques(PROBLEME_HEBDO* problemeHebdo)
for (int pays = 0; pays < problemeHebdo->NombreDePays; pays++)
{
problemeHebdo->CaracteristiquesHydrauliques[pays].MaxDesPmaxHydrauliques = 0.0;
problemeHebdo->CaracteristiquesHydrauliques[pays].MaxDesPmaxHydrauliquesRef = 0.0;
if (!problemeHebdo->CaracteristiquesHydrauliques[pays].PresenceDHydrauliqueModulable)
continue;
const std::vector<double>& ContrainteDePmaxHydrauliqueHoraire
Expand All @@ -68,7 +67,6 @@ void OPT_MaxDesPmaxHydrauliques(PROBLEME_HEBDO* problemeHebdo)
}

problemeHebdo->CaracteristiquesHydrauliques[pays].MaxDesPmaxHydrauliques = pmaxHyd;
problemeHebdo->CaracteristiquesHydrauliques[pays].MaxDesPmaxHydrauliquesRef = pmaxHyd;
}

return;
Expand Down
17 changes: 12 additions & 5 deletions src/solver/optimisation/opt_restaurer_les_donnees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,20 @@ void OPT_RestaurerLesDonnees(const PROBLEME_HEBDO* problemeHebdo, const int opti

for (int pays = 0; pays < problemeHebdo->NombreDePays; pays++)
{
ENERGIES_ET_PUISSANCES_HYDRAULIQUES& CaracteristiquesHydrauliques
= problemeHebdo->CaracteristiquesHydrauliques[pays];
if (CaracteristiquesHydrauliques.PresenceDHydrauliqueModulable)
if (!problemeHebdo->CaracteristiquesHydrauliques[pays].PresenceDHydrauliqueModulable)
continue;

const std::vector<double>& ContrainteDePmaxHydrauliqueHoraire
= problemeHebdo->CaracteristiquesHydrauliques[pays].ContrainteDePmaxHydrauliqueHoraire;

double pmaxHyd = -1;
for (uint pdtHebdo = 0; pdtHebdo < problemeHebdo->NombreDePasDeTemps; pdtHebdo++)
{
CaracteristiquesHydrauliques.MaxDesPmaxHydrauliques
= CaracteristiquesHydrauliques.MaxDesPmaxHydrauliquesRef;
if (ContrainteDePmaxHydrauliqueHoraire[pdtHebdo] > pmaxHyd)
pmaxHyd = ContrainteDePmaxHydrauliqueHoraire[pdtHebdo];
}

problemeHebdo->CaracteristiquesHydrauliques[pays].MaxDesPmaxHydrauliques = pmaxHyd;
}

for (int pdt = 0; pdt < DernierPasDeTemps; pdt++)
Expand Down
2 changes: 0 additions & 2 deletions src/solver/simulation/sim_structure_probleme_economique.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,6 @@ struct ENERGIES_ET_PUISSANCES_HYDRAULIQUES

double MaxDesPmaxHydrauliques;

double MaxDesPmaxHydrauliquesRef;

bool PresenceDePompageModulable;
bool PresenceDHydrauliqueModulable;

Expand Down

0 comments on commit ced1287

Please sign in to comment.