diff --git a/src/solver/hydro/management/management.cpp b/src/solver/hydro/management/management.cpp index f0ae5d1711..7328e3bbe8 100644 --- a/src/solver/hydro/management/management.cpp +++ b/src/solver/hydro/management/management.cpp @@ -369,8 +369,7 @@ bool HydroManagement::checkMinGeneration(uint numSpace, uint year) const return ret; } -template -void HydroManagement::prepareNetDemand(uint numSpace, uint year) +void HydroManagement::prepareNetDemand(uint numSpace, uint year, Data::StudyMode mode) { areas_.each([&](Data::Area& area) { uint z = area.index; @@ -398,7 +397,7 @@ void HydroManagement::prepareNetDemand(uint numSpace, uint year) netdemand = + loadSeries[hour] - windSeries[hour] - scratchpad.miscGenSum[hour] - solarSeries[hour] - ror[hour] - - ((ModeT != Data::stdmAdequacy) ? scratchpad.mustrunSum[hour] + - ((mode != Data::stdmAdequacy) ? scratchpad.mustrunSum[hour] : scratchpad.originalMustrunSum[hour]); } @@ -407,7 +406,7 @@ void HydroManagement::prepareNetDemand(uint numSpace, uint year) { netdemand = loadSeries[hour] - scratchpad.miscGenSum[hour] - ror[hour] - - ((ModeT != Data::stdmAdequacy) ? scratchpad.mustrunSum[hour] + - ((mode != Data::stdmAdequacy) ? scratchpad.mustrunSum[hour] : scratchpad.originalMustrunSum[hour]); area.renewable.list.each([&](const Antares::Data::RenewableCluster& cluster) { @@ -525,11 +524,7 @@ void HydroManagement::makeVentilation(double* randomReservoirLevel, throw FatalError("hydro management: invalid minimum generation"); } - if (parameters_.adequacy()) - prepareNetDemand(numSpace, y); - else - prepareNetDemand(numSpace, y); - + prepareNetDemand(numSpace, y, parameters_.mode); prepareEffectiveDemand(numSpace); prepareMonthlyOptimalGenerations(randomReservoirLevel, y, numSpace); diff --git a/src/solver/hydro/management/management.h b/src/solver/hydro/management/management.h index 67d52f57ad..deb1f1f4d5 100644 --- a/src/solver/hydro/management/management.h +++ b/src/solver/hydro/management/management.h @@ -135,8 +135,7 @@ class HydroManagement final //! check minimum generation is lower than available inflows bool checkMinGeneration(uint numSpace, uint year) const; //! Prepare the net demand for each area - template - void prepareNetDemand(uint numSpace, uint year); + void prepareNetDemand(uint numSpace, uint year, Data::StudyMode mode); //! Prepare the effective demand for each area void prepareEffectiveDemand(uint numSpace); //! Monthly Optimal generations