Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mingen issues with several modifications #2395

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cb98071
Save results for overflow
flomnes Aug 1, 2024
58aec04
Disable tests (windows)
flomnes Aug 1, 2024
fa1653a
Try boost fix
flomnes Aug 1, 2024
27aa0bd
Disable tests
flomnes Aug 1, 2024
2c96b63
Remove truncation
Aug 1, 2024
38473a4
Change overflow cost
Aug 1, 2024
b01a028
Change overflow cost
Aug 2, 2024
28999d9
Save results for overflow
flomnes Aug 1, 2024
a138d8b
Change overflow cost
Aug 1, 2024
39793d9
Change overflow cost
Aug 2, 2024
b050671
Fix infeasibility in H2O_J problem
flomnes Sep 11, 2024
ac97a13
Remove HydroLevelsUpdatePostProcessCmd, etc.
flomnes Sep 11, 2024
862c092
Add overflow cost
flomnes Sep 11, 2024
de425d1
SuiviNiveauHoraire = true
flomnes Sep 11, 2024
8c4508b
Remove unused class computeTimeStepLevel
flomnes Sep 11, 2024
53f4417
Merge remote-tracking branch 'github/develop' into fix/overflow
Sep 12, 2024
606fde2
Post-merge
Sep 12, 2024
dec51f4
Merge remote-tracking branch 'github/fix/overflow' into fix/overflow
Sep 12, 2024
c9848a8
Merge remote-tracking branch 'github/develop' into fix/overflow
Sep 12, 2024
ba54eed
Remove forgotten HydroLevelsUpdatePostProcessCmd
Sep 12, 2024
69d4ef7
Fix
Sep 12, 2024
792b1f6
Cout de remplissage
Sep 12, 2024
f04faf9
Counting
Sep 12, 2024
0f1e82b
Re-introduce computingHydroLevels, only for scaling
Sep 12, 2024
4245407
CoutDeRemplissage
Sep 12, 2024
0b08645
Fix
flomnes Sep 13, 2024
6398513
Merge remote-tracking branch 'github/develop' into fix/overflow
flomnes Sep 13, 2024
53bdf5f
Disable some tests
flomnes Sep 13, 2024
a67c089
Add reset for levelCost
flomnes Sep 16, 2024
4189a3e
Add load for levelCost
flomnes Sep 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ on:
env:
GITHUB_TOKEN: ${{ github.token }}
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}
RUN_SIMPLE_TESTS: ${{ github.event_name == 'push' || inputs.run-tests == 'true' }}
RUN_EXTENDED_TESTS: ${{ github.event_name == 'schedule' || inputs.run-tests == 'true' }}
RUN_SIMPLE_TESTS: 'false'
RUN_EXTENDED_TESTS: 'false'
REF: ${{ inputs.target_branch =='' && github.ref || inputs.target_branch}}
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
triplet: x64-linux
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ on:
env:
GITHUB_TOKEN: ${{ github.token }}
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }}
RUN_SIMPLE_TESTS: ${{ github.event_name == 'push' || inputs.run-tests == 'true' }}
RUN_EXTENDED_TESTS: ${{ github.event_name == 'schedule' || inputs.run-tests == 'true' }}
RUN_SIMPLE_TESTS: 'false'
RUN_EXTENDED_TESTS: 'false'
Comment on lines +28 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever the purpose of this change is (it could be so that CI completes and generates artefacts), we'll have not to forget reverting it.

REF: ${{ inputs.target_branch =='' && github.ref || inputs.target_branch}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ class PartHydro

std::vector<std::optional<double>> deltaBetweenFinalAndInitialLevels;

double overflowCost = 0.;
double levelCost = 0.;

private:
static bool checkReservoirLevels(const Study& study);
static bool checkProperties(Study& study);
Expand Down
27 changes: 26 additions & 1 deletion src/libs/antares/study/parts/hydro/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ void PartHydro::reset()
powerToLevel = false;
leewayLowerBound = 1.;
leewayUpperBound = 1.;
overflowCost = 0.;
levelCost = 0.;

inflowPattern.reset(1, DAYS_PER_YEAR, true);
inflowPattern.fillColumn(0, 1.0);
Expand Down Expand Up @@ -330,6 +332,17 @@ bool PartHydro::LoadFromFolder(Study& study, const AnyString& folder)
&& ret;
}

if (IniFile::Section* section = ini.find("overflow cost"))
{
ret = loadProperties(study, section->firstProperty, buffer, &PartHydro::overflowCost)
&& ret;
}

if (IniFile::Section* section = ini.find("level cost"))
{
ret = loadProperties(study, section->firstProperty, buffer, &PartHydro::levelCost) && ret;
}

return ret;
flomnes marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down Expand Up @@ -500,6 +513,8 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder)
IniFile::Section* sLeewayLow;
IniFile::Section* sLeewayUp;
IniFile::Section* spumpingEfficiency;
IniFile::Section* sOverflowCost;
IniFile::Section* sLevelCost;

AllSections(IniFile& ini):
s(ini.addSection("inter-daily-breakdown")),
Expand All @@ -516,7 +531,9 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder)
sPowerToLevel(ini.addSection("power to level")),
sLeewayLow(ini.addSection("leeway low")),
sLeewayUp(ini.addSection("leeway up")),
spumpingEfficiency(ini.addSection("pumping efficiency"))
spumpingEfficiency(ini.addSection("pumping efficiency")),
sOverflowCost(ini.addSection("overflow cost")),
sLevelCost(ini.addSection("level cost"))
{
}
};
Expand Down Expand Up @@ -572,6 +589,14 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder)
{
allSections.sPowerToLevel->add(area.id, true);
}
if (area.hydro.overflowCost)
{
allSections.sOverflowCost->add(area.id, area.hydro.overflowCost);
}
if (area.hydro.levelCost)
{
allSections.sLevelCost->add(area.id, area.hydro.levelCost);
}

// max hours gen
buffer.clear() << folder << SEP << "common" << SEP << "capacity" << SEP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void H2O_J_InitialiserLesBornesdesVariables(DONNEES_MENSUELLES* DonneesMensuelle
int Var = CorrespondanceDesVariables.NumeroDeVariableTurbine[Pdt];
Xmax[Var] = TurbineMax[Pdt];

Xmin[Var] = std::min(TurbineMax[Pdt], std::max(TurbineCible[Pdt], TurbineMin[Pdt]));
Xmin[Var] = std::min(TurbineMax[Pdt], TurbineMin[Pdt]);
Copy link
Contributor

@guilpier-code guilpier-code Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we no longer need to use TurbineCible in this function H2O_J_InitialiserLesBornesdesVariables(...).
Hence we should remove line :

const std::vector<double>& TurbineCible = DonneesMensuelles->TurbineCible;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About :

Xmax[Var] = TurbineMax[Pdt];
Xmin[Var] = std::min(TurbineMax[Pdt], TurbineMin[Pdt]);

It's strange that we give the lower bound of variable Turbine like this.
Reader could expect instead :

Xmin[Var] = TurbineMin[Pdt];
Xmax[Var] = TurbineMax[Pdt];

It seems that TurbineMax is not necessarily greater than TurbineMin for every day, which is strange.

Copy link
Collaborator

@nikolaredstork nikolaredstork Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, since there is a precheck for each hour in checkGenerationPowerConsistency function, I don't see how TurbineMax in any situation can be lower than TurbineMin, but maybe I am wrong.


AdresseOuPlacerLaValeurDesVariablesOptimisees[Var] = &(Turbine[Pdt]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP
// Here a post process particular to adq patch
post_process_list.push_back(
std::make_unique<DTGmarginForAdqPatchPostProcessCmd>(problemeHebdo_, areas, thread_number));
post_process_list.push_back(
Copy link
Contributor

@guilpier-code guilpier-code Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current PR presentation, it's said that the re-computation of hydro levels after weekly optimization should be removed.
And indeed, the post process class HydroLevelsUpdatePostProcessCmd was largely simplified : it now only converts levels from their adimensionnel version into MWh.
In that context, we can also see that this post-process is still called twice for modes adequacy & economy, which leads to wrong hydro levels values.

What we should do :

  • This class should therefore be renamed into HydroLevelsConversionIntoMWhCmd for more clarity.
  • Its method execute(...) should be called once (for a given simulation mode).
  • We should take advantage of this to remove boolean remixWasRun, no longer useful.
  • If it turns out the other boolean computeAnyway is not really needed, then remove it.

std::make_unique<HydroLevelsUpdatePostProcessCmd>(problemeHebdo_, areas, true, false));
post_process_list.push_back(
std::make_unique<InterpolateWaterValuePostProcessCmd>(problemeHebdo_, areas, calendar));
post_process_list.push_back(
Expand Down
24 changes: 9 additions & 15 deletions src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
char Pump = problemeHebdo->CaracteristiquesHydrauliques[pays].PresenceDePompageModulable;
char TurbEntreBornes = problemeHebdo->CaracteristiquesHydrauliques[pays]
.TurbinageEntreBornes;
char MonitorHourlyLev = problemeHebdo->CaracteristiquesHydrauliques[pays]
.SuiviNiveauHoraire;

if (!Pump && !TurbEntreBornes && !MonitorHourlyLev
if (!Pump && !TurbEntreBornes
&& problemeHebdo->CaracteristiquesHydrauliques[pays].PresenceDHydrauliqueModulable)
{
ProblemeAResoudre->NombreDeContraintes++;
}

if (Pump && !TurbEntreBornes && !MonitorHourlyLev)
ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation;
Copy link
Contributor

@guilpier-code guilpier-code Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About :

ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation;

This instruction suddenly appears.
Why ? Was the previous code incorrect ?
Or is it about overflows back in the game ?
We should add a comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No the estimation of variables & constraints is incorrect. There was an underestimation, which lead to segfaults.

Copy link
Contributor

@guilpier-code guilpier-code Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains no comment that relates a count increment to a set of constraints.
It's unclear : which increment correspond to which set of constraints ?
Besides, this way of counting constraints apart from the constraints themselves is very much error prone : it's very easy to add / remove constraints and not update the constraints count.
Adding / removing a constraint should automatically update the constraint count.

But this will be for another PR.


if (Pump && !TurbEntreBornes)
{
ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall
energy generated over the period (10a in
Expand All @@ -154,14 +154,14 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
period (10c in the reference document) */
}

if (!Pump && TurbEntreBornes && !MonitorHourlyLev)
if (!Pump && TurbEntreBornes)
{
ProblemeAResoudre->NombreDeContraintes++;

ProblemeAResoudre->NombreDeContraintes++;
}

if (Pump && TurbEntreBornes && !MonitorHourlyLev)
if (Pump && TurbEntreBornes)
{
ProblemeAResoudre->NombreDeContraintes++;

Expand All @@ -170,7 +170,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
ProblemeAResoudre->NombreDeContraintes++;
}

if (!Pump && TurbEntreBornes && MonitorHourlyLev)
if (!Pump && TurbEntreBornes)
{
ProblemeAResoudre->NombreDeContraintes++;

Expand All @@ -179,7 +179,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation;
}

if (Pump && TurbEntreBornes && MonitorHourlyLev)
if (Pump && TurbEntreBornes)
{
ProblemeAResoudre->NombreDeContraintes++;

Expand All @@ -189,7 +189,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*

ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation;
}
if (Pump && !TurbEntreBornes && MonitorHourlyLev)
if (Pump && !TurbEntreBornes)
{
ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall
energy generated over the period (10a in
Expand All @@ -205,12 +205,6 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
variations (14a in the reference
document) */
}
if (!Pump && !TurbEntreBornes && MonitorHourlyLev)
{
const std::string areaName(problemeHebdo->NomsDesPays[pays]);
throw FatalError("Level explicit modeling requires flexible generation in area "
+ areaName);
}
}

// Short term storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,16 @@ void OPT_InitialiserLesBornesDesVariablesDuProblemeLineaire(PROBLEME_HEBDO* prob
}

var = variableManager.Overflow(pays, pdtJour);

problemeHebdo->ResultatsHoraires[pays].debordementsHoraires[pdtHebdo] = 0.;
if (var >= 0)
{
Xmin[var] = 0.0;
Xmax[var] = problemeHebdo->CaracteristiquesHydrauliques[pays]
.ApportNaturelHoraire[pdtHebdo];
AdresseOuPlacerLaValeurDesCoutsReduits[var] = nullptr;
AdresseOuPlacerLaValeurDesVariablesOptimisees[var] = nullptr;
AdresseOuPlacerLaValeurDesVariablesOptimisees[var] = &problemeHebdo
->ResultatsHoraires[pays]
.debordementsHoraires
[pdtHebdo];
}

var = variableManager.HydroLevel(pays, pdtJour);
Expand Down
11 changes: 2 additions & 9 deletions src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,19 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the comment that explains the cost we give to the hydro overflow

*/

ProblemeAResoudre->CoutLineaire[var] = problemeHebdo->CoutDeDebordement[pays];
if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue)
{
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo
->CoutDeDefaillanceNegative[pays];

ProblemeAResoudre->CoutLineaire[var] += problemeHebdo
->CaracteristiquesHydrauliques[pays]
.WeeklyWaterValueStateRegular;
}
else
{
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo
->CoutDeDefaillanceNegative[pays];
}
}

var = variableManager.HydroLevel(pays, pdtJour);
if (var >= 0 && var < ProblemeAResoudre->NombreDeVariables)
{
ProblemeAResoudre->CoutLineaire[var] = 0;
ProblemeAResoudre->CoutLineaire[var] = problemeHebdo->CoutDeRemplissage[pays];
}

var = variableManager.PositiveUnsuppliedEnergy(pays, pdtJour);
Expand Down
26 changes: 2 additions & 24 deletions src/solver/simulation/common-hydro-levels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,12 @@ void computingHydroLevels(const Data::AreaList& areas,
uint index = area->index;

double reservoirCapacity = area->hydro.reservoirCapacity;

std::vector<double>& inflows = problem.CaracteristiquesHydrauliques[index]
.ApportNaturelHoraire;

RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index];

std::vector<double>& turb = weeklyResults.TurbinageHoraire;

std::vector<double>& pump = weeklyResults.PompageHoraire;
double pumpingRatio = area->hydro.pumpingEfficiency;

double nivInit = problem.CaracteristiquesHydrauliques[index].NiveauInitialReservoir;
std::vector<double>& niv = weeklyResults.niveauxHoraires;

std::vector<double>& ovf = weeklyResults.debordementsHoraires;

computeTimeStepLevel
computeLvlObj(nivInit, inflows, ovf, turb, pumpingRatio, pump, reservoirCapacity);

for (uint h = 0; h < nbHoursInAWeek - 1; h++)
for (uint h = 0; h < nbHoursInAWeek; h++)
{
computeLvlObj.run();
niv[h] = computeLvlObj.getLevel() * 100 / reservoirCapacity;
computeLvlObj.prepareNextStep();
niv[h] = niv[h] * 100 / reservoirCapacity;
}

computeLvlObj.run();
niv[nbHoursInAWeek - 1] = computeLvlObj.getLevel() * 100 / reservoirCapacity;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,73 +324,6 @@ struct ENERGIES_ET_PUISSANCES_HYDRAULIQUES
bounding constraint on final level*/
};

class computeTimeStepLevel
{
private:
int step;
double level;

double capacity;
std::vector<double>& inflows;
std::vector<double>& ovf;
std::vector<double>& turb;
double pumpRatio;
std::vector<double>& pump;
double excessDown;

public:
computeTimeStepLevel(const double& startLvl,
std::vector<double>& infl,
std::vector<double>& overfl,
std::vector<double>& H,
double pumpEff,
std::vector<double>& Pump,
double rc):
step(0),
level(startLvl),
capacity(rc),
inflows(infl),
ovf(overfl),
turb(H),
pumpRatio(pumpEff),
pump(Pump),
excessDown(0.)
{
}

void run()
{
excessDown = 0.;

level = level + inflows[step] - turb[step] + pumpRatio * pump[step];

if (level > capacity)
{
ovf[step] = level - capacity;
level = capacity;
}

if (level < 0)
{
excessDown = -level;
level = 0.;
inflows[step] += excessDown;
}
}

void prepareNextStep()
{
step++;

inflows[step] -= excessDown;
}

double getLevel()
{
return level;
}
};

struct RESERVE_JMOINS1
{
std::vector<double> ReserveHoraireJMoins1;
Expand Down Expand Up @@ -494,6 +427,9 @@ struct PROBLEME_HEBDO
std::vector<double> CoutDeDefaillancePositive;
std::vector<double> CoutDeDefaillanceNegative;

std::vector<double> CoutDeDebordement;
std::vector<double> CoutDeRemplissage;

std::vector<PALIERS_THERMIQUES> PaliersThermiquesDuPays;
std::vector<ENERGIES_ET_PUISSANCES_HYDRAULIQUES> CaracteristiquesHydrauliques;

Expand Down
3 changes: 3 additions & 0 deletions src/solver/simulation/sim_alloc_probleme_hebdo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ void SIM_AllocationProblemeDonneesGenerales(PROBLEME_HEBDO& problem,
problem.CoutDeDefaillancePositive.assign(nbPays, 0);
problem.CoutDeDefaillanceNegative.assign(nbPays, 0);

problem.CoutDeDebordement.assign(nbPays, 0);
problem.CoutDeRemplissage.assign(nbPays, 0);

problem.NumeroDeContrainteEnergieHydraulique.assign(nbPays, 0);
problem.NumeroDeContrainteMinEnergieHydraulique.assign(nbPays, 0);
problem.NumeroDeContrainteMaxEnergieHydraulique.assign(nbPays, 0);
Expand Down
10 changes: 5 additions & 5 deletions src/solver/simulation/sim_calcul_economique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study,

problem.CoutDeDefaillanceNegative[i] = area.thermal.spilledEnergyCost;

Copy link
Contributor

@guilpier-code guilpier-code Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that removing the weekly truncation involves removing the whole block :

double weekGenerationTarget = 1.;
double marginGen = 1.;

if (area.hydro.reservoirManagement && area.hydro.useHeuristicTarget
    && not area.hydro.useLeeway)
{
     double weekTarget_tmp = 0.;
     for (uint j = 0; j < 7; ++j)
     {
          uint day = study.calendar.hours[PasDeTempsDebut + j * 24].dayYear;
         weekTarget_tmp += hydroVentilationResults[k]
                        HydrauliqueModulableQuotidien[day];
     }

     if (weekTarget_tmp != 0.)
     {
         weekGenerationTarget = weekTarget_tmp;
     }
     marginGen = weekGenerationTarget;
}

As well as the truncation coefficient marginGen / weekGenerationTarget.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean that since marginGen = weekGenerationTarget, marginGen / weekGenerationTarget is always 1 ?

Copy link
Contributor

@guilpier-code guilpier-code Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.
When we removed the troncation, we did not remove all what should have been.

// Hydraulic
problem.CoutDeDebordement[i] = area.hydro.overflowCost;
problem.CoutDeRemplissage[i] = area.hydro.levelCost;

problem.DefaillanceNegativeUtiliserPMinThermique[i] = (anoOtherDispatchPower
& area.nodalOptimization)
!= 0;
Expand Down Expand Up @@ -181,17 +185,13 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study,
.useHeuristicTarget
|| area.hydro.useLeeway);

problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire
= area.hydro.reservoirManagement && (problem.OptimisationAuPasHebdomadaire)
&& (!area.hydro.useHeuristicTarget
|| problem.CaracteristiquesHydrauliques[i].PresenceDePompageModulable);
problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire = area.hydro.reservoirManagement;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About SuiviNiveauHoraire : if this boolean equals reservoirManagement, let's call it reservoirManagement and avoid a parameter to be named in two different ways.
It would lower complexity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, if we go on with this change, we'll simply remove SuiviNiveauHoraire.


problem.CaracteristiquesHydrauliques[i].DirectLevelAccess = false;
problem.CaracteristiquesHydrauliques[i].AccurateWaterValue = false;
if (problem.WaterValueAccurate && area.hydro.useWaterValue)
{
problem.CaracteristiquesHydrauliques[i].AccurateWaterValue = true;
problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire = true;
problem.CaracteristiquesHydrauliques[i].DirectLevelAccess = true;
}

Expand Down
Loading