From cb980716908bfb8d0d08ef0a8811c8f3a8713016 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 1 Aug 2024 11:06:41 +0200 Subject: [PATCH 01/28] Save results for overflow --- .../optimisation/opt_gestion_des_bornes_cas_lineaire.cpp | 9 +++++---- .../optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 3 ++- .../simulation/sim_structure_probleme_economique.h | 3 +-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp index dda3b10423..9e43f38023 100644 --- a/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp @@ -433,15 +433,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] = NULL; - AdresseOuPlacerLaValeurDesVariablesOptimisees[var] = NULL; + AdresseOuPlacerLaValeurDesCoutsReduits[var] = nullptr; + AdresseOuPlacerLaValeurDesVariablesOptimisees[var] = &problemeHebdo + ->ResultatsHoraires[pays] + .debordementsHoraires + [pdtHebdo]; } var = variableManager.HydroLevel(pays, pdtJour); diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index c2d1859106..cb5fa2a142 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -290,7 +290,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, else { ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays]; + ->CoutDeDefaillanceNegative[pays] + * 1.10; } } diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index 307be5b068..489488486e 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -367,11 +367,10 @@ class computeTimeStepLevel { excessDown = 0.; - level = level + inflows[step] - turb[step] + pumpRatio * pump[step]; + level = level + inflows[step] - turb[step] + pumpRatio * pump[step] - ovf[step]; if (level > capacity) { - ovf[step] = level - capacity; level = capacity; } From 58aec04bc0a0140a5d169e010f83d27464ed9f59 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 1 Aug 2024 11:40:58 +0200 Subject: [PATCH 02/28] Disable tests (windows) --- .github/workflows/windows-vcpkg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index 04d9f72c53..96e0dda4c4 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -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}} From fa1653ac35aaaa9f538f05d4a61c58656dd34e24 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 1 Aug 2024 13:34:02 +0200 Subject: [PATCH 03/28] Try boost fix --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index adfa646d54..97137c04e0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -235,6 +235,8 @@ add_subdirectory(antares-deps) #Add needed definition in case of external dependencies compilation include (antares-deps/cmake/additionnal-definitions.cmake) +set(Boost_LIB_PREFIX "lib") +set(Boost_DEBUG 1) #Boost header libraries find_package(Boost REQUIRED) From 27aa0bdf623e1babf3296037d9d04080f82573b9 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 1 Aug 2024 13:53:01 +0200 Subject: [PATCH 04/28] Disable tests --- .github/workflows/windows-vcpkg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index 96e0dda4c4..e9bda8e410 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -149,7 +149,7 @@ jobs: -DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \ -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TESTING=ON \ + -DBUILD_TESTING=OFF \ -DBUILD_TOOLS=ON \ -DBUILD_not_system=OFF \ -DPython3_EXECUTABLE="${{ env.Python3_ROOT_DIR }}/python.exe" \ From 2c96b630699e1eecce65e64286d980b62c174ff3 Mon Sep 17 00:00:00 2001 From: Juliette-Gerbaux Date: Thu, 1 Aug 2024 15:00:02 +0200 Subject: [PATCH 05/28] Remove truncation --- src/solver/simulation/sim_calcul_economique.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index 8b921dfec3..0581436cb4 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -844,12 +844,6 @@ void SIM_RenseignementProblemeHebdo(const Study& study, } marginGen = weekGenerationTarget; - - if (problem.CaracteristiquesHydrauliques[k].NiveauInitialReservoir - < weekTarget_tmp) - { - marginGen = problem.CaracteristiquesHydrauliques[k].NiveauInitialReservoir; - } } if (not problem.CaracteristiquesHydrauliques[k].TurbinageEntreBornes) From 38473a40073fd8fb19799ca13c7de6df1aea73ec Mon Sep 17 00:00:00 2001 From: Juliette-Gerbaux Date: Thu, 1 Aug 2024 15:53:45 +0200 Subject: [PATCH 06/28] Change overflow cost --- src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index cb5fa2a142..0e2c14ebb7 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -281,7 +281,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue) { ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays]; + ->CoutDeDefaillanceNegative[pays] + * 1.10; ProblemeAResoudre->CoutLineaire[var] += problemeHebdo ->CaracteristiquesHydrauliques[pays] From b01a028bb06de3685335937b016932bdb95e12c1 Mon Sep 17 00:00:00 2001 From: Juliette-Gerbaux Date: Fri, 2 Aug 2024 08:55:35 +0200 Subject: [PATCH 07/28] Change overflow cost --- .../optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index 0e2c14ebb7..31a401e768 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -280,8 +280,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue) { - ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays] + ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo + ->CoutDeDefaillanceNegative[pays]) * 1.10; ProblemeAResoudre->CoutLineaire[var] += problemeHebdo @@ -290,8 +290,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, } else { - ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays] + ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo + ->CoutDeDefaillanceNegative[pays]) * 1.10; } } From 28999d9f46fd324e1ee3dde9263a3f88c9b193e0 Mon Sep 17 00:00:00 2001 From: Florian OMNES Date: Thu, 1 Aug 2024 11:06:41 +0200 Subject: [PATCH 08/28] Save results for overflow --- .../optimisation/opt_gestion_des_bornes_cas_lineaire.cpp | 7 ++++--- .../optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 3 ++- .../solver/simulation/sim_structure_probleme_economique.h | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp index 0cc9c93258..a5c23adebb 100644 --- a/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp @@ -417,15 +417,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); diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index 9831750143..fe70f0290f 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -287,7 +287,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, else { ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays]; + ->CoutDeDefaillanceNegative[pays] + * 1.10; } } diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index 11d1ea116a..26b8e837ef 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -362,11 +362,10 @@ class computeTimeStepLevel { excessDown = 0.; - level = level + inflows[step] - turb[step] + pumpRatio * pump[step]; + level = level + inflows[step] - turb[step] + pumpRatio * pump[step] - ovf[step]; if (level > capacity) { - ovf[step] = level - capacity; level = capacity; } From a138d8b985d6a4a432dfb55b12fa4eedb1b7627d Mon Sep 17 00:00:00 2001 From: Juliette-Gerbaux Date: Thu, 1 Aug 2024 15:53:45 +0200 Subject: [PATCH 09/28] Change overflow cost --- src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index fe70f0290f..13d45c0996 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -278,7 +278,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue) { ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays]; + ->CoutDeDefaillanceNegative[pays] + * 1.10; ProblemeAResoudre->CoutLineaire[var] += problemeHebdo ->CaracteristiquesHydrauliques[pays] From 39793d96d09d681607cbaf3ab1627d6064378b79 Mon Sep 17 00:00:00 2001 From: Juliette-Gerbaux Date: Fri, 2 Aug 2024 08:55:35 +0200 Subject: [PATCH 10/28] Change overflow cost --- .../optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index 13d45c0996..4ea8c80457 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -277,8 +277,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue) { - ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays] + ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo + ->CoutDeDefaillanceNegative[pays]) * 1.10; ProblemeAResoudre->CoutLineaire[var] += problemeHebdo @@ -287,8 +287,8 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, } else { - ProblemeAResoudre->CoutLineaire[var] = problemeHebdo - ->CoutDeDefaillanceNegative[pays] + ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo + ->CoutDeDefaillanceNegative[pays]) * 1.10; } } From b05067117d540e6be5b47ad5c5a49d23535a2258 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:39:05 +0200 Subject: [PATCH 11/28] Fix infeasibility in H2O_J problem --- .../hydro/daily/h2o_j_initialiser_les_bornes_des_variables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solver/hydro/daily/h2o_j_initialiser_les_bornes_des_variables.cpp b/src/solver/hydro/daily/h2o_j_initialiser_les_bornes_des_variables.cpp index 50f6e72bd5..fa7dab5a4c 100644 --- a/src/solver/hydro/daily/h2o_j_initialiser_les_bornes_des_variables.cpp +++ b/src/solver/hydro/daily/h2o_j_initialiser_les_bornes_des_variables.cpp @@ -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]); AdresseOuPlacerLaValeurDesVariablesOptimisees[Var] = &(Turbine[Pdt]); } From ac97a130974db05179489ccf14f3eefde7948d27 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:43:17 +0200 Subject: [PATCH 12/28] Remove HydroLevelsUpdatePostProcessCmd, etc. --- .../adq_patch_post_process_list.cpp | 6 +- .../optimisation/post_process_commands.h | 15 ----- .../optimisation/optim_post_process_list.cpp | 6 +- .../optimisation/post_process_commands.cpp | 19 ------ src/solver/simulation/adequacy.cpp | 6 -- src/solver/simulation/common-hydro-levels.cpp | 64 ++----------------- .../solver/simulation/common-eco-adq.h | 12 ---- 7 files changed, 9 insertions(+), 119 deletions(-) diff --git a/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp b/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp index 1ed1e80371..95ce1c5555 100644 --- a/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp +++ b/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp @@ -41,8 +41,7 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP problemeHebdo_, areas, thread_number_)); - post_process_list.push_back( - std::make_unique(problemeHebdo_, areas, false, false)); + post_process_list.push_back(std::make_unique(problemeHebdo_, areas, sheddingPolicy, @@ -54,8 +53,7 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP problemeHebdo_, areas, thread_number)); - post_process_list.push_back( - std::make_unique(problemeHebdo_, areas, true, false)); + post_process_list.push_back( std::make_unique(problemeHebdo_, areas, calendar)); post_process_list.push_back( diff --git a/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h b/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h index 652ab48132..2d2ad8f0cd 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h @@ -37,21 +37,6 @@ class DispatchableMarginPostProcessCmd: public basePostProcessCommand const AreaList& area_list_; }; -class HydroLevelsUpdatePostProcessCmd: public basePostProcessCommand -{ -public: - HydroLevelsUpdatePostProcessCmd(PROBLEME_HEBDO* problemeHebdo, - AreaList& areas, - bool remixWasRun, - bool computeAnyway); - void execute(const optRuntimeData& opt_runtime_data) override; - -private: - const AreaList& area_list_; - bool remixWasRun_ = false; - bool computeAnyway_ = false; -}; - class RemixHydroPostProcessCmd: public basePostProcessCommand { public: diff --git a/src/solver/optimisation/optim_post_process_list.cpp b/src/solver/optimisation/optim_post_process_list.cpp index a9eb38f7e8..baceb7f9d6 100644 --- a/src/solver/optimisation/optim_post_process_list.cpp +++ b/src/solver/optimisation/optim_post_process_list.cpp @@ -37,15 +37,13 @@ OptPostProcessList::OptPostProcessList(PROBLEME_HEBDO* problemeHebdo, { post_process_list.push_back( std::make_unique(problemeHebdo_, thread_number_, areas)); - post_process_list.push_back( - std::make_unique(problemeHebdo_, areas, false, false)); + post_process_list.push_back(std::make_unique(problemeHebdo_, areas, sheddingPolicy, splxOptimization, thread_number)); - post_process_list.push_back( - std::make_unique(problemeHebdo_, areas, true, false)); + post_process_list.push_back( std::make_unique(problemeHebdo_, areas, calendar)); post_process_list.push_back( diff --git a/src/solver/optimisation/post_process_commands.cpp b/src/solver/optimisation/post_process_commands.cpp index fb628d694d..7b48927363 100644 --- a/src/solver/optimisation/post_process_commands.cpp +++ b/src/solver/optimisation/post_process_commands.cpp @@ -70,25 +70,6 @@ void DispatchableMarginPostProcessCmd::execute(const optRuntimeData& opt_runtime }); } -// ----------------------------- -// Hydro levels update -// ----------------------------- -HydroLevelsUpdatePostProcessCmd::HydroLevelsUpdatePostProcessCmd(PROBLEME_HEBDO* problemeHebdo, - AreaList& areas, - bool remixWasRun, - bool computeAnyway): - basePostProcessCommand(problemeHebdo), - area_list_(areas), - remixWasRun_(remixWasRun), - computeAnyway_(computeAnyway) -{ -} - -void HydroLevelsUpdatePostProcessCmd::execute(const optRuntimeData&) -{ - computingHydroLevels(area_list_, *problemeHebdo_, remixWasRun_, computeAnyway_); -} - // ----------------------------- // Remix Hydro // ----------------------------- diff --git a/src/solver/simulation/adequacy.cpp b/src/solver/simulation/adequacy.cpp index eed49029e8..ca6a9b25bb 100644 --- a/src/solver/simulation/adequacy.cpp +++ b/src/solver/simulation/adequacy.cpp @@ -215,16 +215,12 @@ bool Adequacy::year(Progression::Task& progression, resultWriter, simulationObserver_.get()); - computingHydroLevels(study.areas, currentProblem, false); - RemixHydroForAllAreas(study.areas, currentProblem, study.parameters.shedding.policy, study.parameters.simplexOptimizationRange, numSpace, hourInTheYear); - - computingHydroLevels(study.areas, currentProblem, true); } catch (Data::AssertionError& ex) { @@ -329,8 +325,6 @@ bool Adequacy::year(Progression::Task& progression, .ConsommationAbattueDuPays[k]; } } - - computingHydroLevels(study.areas, currentProblem, false, true); } interpolateWaterValue(study.areas, currentProblem, study.calendar, hourInTheYear); diff --git a/src/solver/simulation/common-hydro-levels.cpp b/src/solver/simulation/common-hydro-levels.cpp index b0ba258b0e..3694da72f7 100644 --- a/src/solver/simulation/common-hydro-levels.cpp +++ b/src/solver/simulation/common-hydro-levels.cpp @@ -28,57 +28,6 @@ namespace Antares::Solver::Simulation { using Constants::nbHoursInAWeek; -void computingHydroLevels(const Data::AreaList& areas, - PROBLEME_HEBDO& problem, - bool remixWasRun, - bool computeAnyway) -{ - for (const auto& [_, area]: areas) - { - if (!area->hydro.reservoirManagement) - { - continue; - } - - if (!computeAnyway && area->hydro.useHeuristicTarget != remixWasRun) - { - continue; - } - - uint index = area->index; - - double reservoirCapacity = area->hydro.reservoirCapacity; - - std::vector& inflows = problem.CaracteristiquesHydrauliques[index] - .ApportNaturelHoraire; - - RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index]; - - std::vector& turb = weeklyResults.TurbinageHoraire; - - std::vector& pump = weeklyResults.PompageHoraire; - double pumpingRatio = area->hydro.pumpingEfficiency; - - double nivInit = problem.CaracteristiquesHydrauliques[index].NiveauInitialReservoir; - std::vector& niv = weeklyResults.niveauxHoraires; - - std::vector& ovf = weeklyResults.debordementsHoraires; - - computeTimeStepLevel - computeLvlObj(nivInit, inflows, ovf, turb, pumpingRatio, pump, reservoirCapacity); - - for (uint h = 0; h < nbHoursInAWeek - 1; h++) - { - computeLvlObj.run(); - niv[h] = computeLvlObj.getLevel() * 100 / reservoirCapacity; - computeLvlObj.prepareNextStep(); - } - - computeLvlObj.run(); - niv[nbHoursInAWeek - 1] = computeLvlObj.getLevel() * 100 / reservoirCapacity; - } -} - void interpolateWaterValue(const Data::AreaList& areas, PROBLEME_HEBDO& problem, const Date::Calendar& calendar, @@ -115,7 +64,7 @@ void interpolateWaterValue(const Data::AreaList& areas, double reservoirCapacity = area->hydro.reservoirCapacity; - std::vector& niv = weeklyResults.niveauxHoraires; + const std::vector& niv = weeklyResults.niveauxHoraires; waterVal[0] = Data::getWaterValue(problem.previousSimulationFinalLevel[index] * 100 / reservoirCapacity, @@ -140,14 +89,11 @@ void updatingWeeklyFinalHydroLevel(const Data::AreaList& areas, PROBLEME_HEBDO& continue; } - uint index = area->index; - - double reservoirCapacity = area->hydro.reservoirCapacity; - - RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index]; - - std::vector& niv = weeklyResults.niveauxHoraires; + const double reservoirCapacity = area->hydro.reservoirCapacity; + const uint index = area->index; + const RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index]; + const std::vector& niv = weeklyResults.niveauxHoraires; problem.previousSimulationFinalLevel[index] = niv[nbHoursInAWeek - 1] * reservoirCapacity / 100; } diff --git a/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h b/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h index 6a4dabd763..8f89b4998a 100644 --- a/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h +++ b/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h @@ -95,18 +95,6 @@ void RemixHydroForAllAreas(const Data::AreaList& areas, uint numSpace, uint hourInYear); -/* -** \brief Computing levels from hydro generation, natural and pumping inflows -** -** If hydro remix was not done yet, levels are computed only for areas for which we do not use the -*heuristic -** If hydro remix was done, levels are computed only for areas for which we use the heuristic -*/ -void computingHydroLevels(const Data::AreaList& areas, - PROBLEME_HEBDO& problem, - bool remixWasRun, - bool computeAnyway = false); - /* ** \brief Interpolates water values related to reservoir levels for outputs only ** From 862c092cd6f9f34a3c65c70e410e613070b0b074 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:06:13 +0200 Subject: [PATCH 13/28] Add overflow cost --- .../antares/study/parts/hydro/container.h | 2 ++ src/libs/antares/study/parts/hydro/container.cpp | 16 +++++++++++++++- .../opt_gestion_des_couts_cas_lineaire.cpp | 11 +---------- .../sim_structure_probleme_economique.h | 2 ++ .../simulation/sim_alloc_probleme_hebdo.cpp | 2 ++ src/solver/simulation/sim_calcul_economique.cpp | 2 ++ 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/libs/antares/study/include/antares/study/parts/hydro/container.h b/src/libs/antares/study/include/antares/study/parts/hydro/container.h index 1da5ab6023..8b8533da8c 100644 --- a/src/libs/antares/study/include/antares/study/parts/hydro/container.h +++ b/src/libs/antares/study/include/antares/study/parts/hydro/container.h @@ -224,6 +224,8 @@ class PartHydro std::vector> deltaBetweenFinalAndInitialLevels; + double overflowCost = 0.; + private: static bool checkReservoirLevels(const Study& study); static bool checkProperties(Study& study); diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index 336595b95b..06cb68ec1e 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -89,6 +89,8 @@ void PartHydro::reset() allocation.clear(); // allocation.fromArea(, 1.); // Area::reset() + overflowCost = 0.; + if (prepro) { prepro->reset(); @@ -330,6 +332,12 @@ 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; + } + return ret; } @@ -500,6 +508,7 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder) IniFile::Section* sLeewayLow; IniFile::Section* sLeewayUp; IniFile::Section* spumpingEfficiency; + IniFile::Section* sOverflowCost; AllSections(IniFile& ini): s(ini.addSection("inter-daily-breakdown")), @@ -516,7 +525,8 @@ 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")) { } }; @@ -572,6 +582,10 @@ 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); + } // max hours gen buffer.clear() << folder << SEP << "common" << SEP << "capacity" << SEP diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index 4ea8c80457..9457d5cae4 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -275,22 +275,13 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, */ + ProblemeAResoudre->CoutLineaire[var] = problemeHebdo->CoutDeDebordement[pays]; if (!problemeHebdo->CaracteristiquesHydrauliques[pays].AccurateWaterValue) { - ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo - ->CoutDeDefaillanceNegative[pays]) - * 1.10; - ProblemeAResoudre->CoutLineaire[var] += problemeHebdo ->CaracteristiquesHydrauliques[pays] .WeeklyWaterValueStateRegular; } - else - { - ProblemeAResoudre->CoutLineaire[var] = abs(problemeHebdo - ->CoutDeDefaillanceNegative[pays]) - * 1.10; - } } var = variableManager.HydroLevel(pays, pdtJour); diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index 26b8e837ef..fff1e76b6e 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -494,6 +494,8 @@ struct PROBLEME_HEBDO std::vector CoutDeDefaillanceNegative; std::vector CoutDeDefaillanceEnReserve; + std::vector CoutDeDebordement; + std::vector PaliersThermiquesDuPays; std::vector CaracteristiquesHydrauliques; diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index 305d5fb31b..7d13891ec9 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -86,6 +86,8 @@ void SIM_AllocationProblemeDonneesGenerales(PROBLEME_HEBDO& problem, problem.CoutDeDefaillanceNegative.assign(nbPays, 0); problem.CoutDeDefaillanceEnReserve.assign(nbPays, 0); + problem.CoutDeDebordement.assign(nbPays, 0); + problem.NumeroDeContrainteEnergieHydraulique.assign(nbPays, 0); problem.NumeroDeContrainteMinEnergieHydraulique.assign(nbPays, 0); problem.NumeroDeContrainteMaxEnergieHydraulique.assign(nbPays, 0); diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index e14f85e945..05183608d6 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -152,6 +152,8 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study, problem.CoutDeDefaillanceNegative[i] = area.thermal.spilledEnergyCost; + problem.CoutDeDebordement[i] = area.hydro.overflowCost; + problem.CoutDeDefaillanceEnReserve[i] = area.thermal.unsuppliedEnergyCost; problem.DefaillanceNegativeUtiliserPMinThermique[i] = (anoOtherDispatchPower From de425d1971e2645c5397f626e84c71cffb1017aa Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:16:49 +0200 Subject: [PATCH 14/28] SuiviNiveauHoraire = true --- .../solver/simulation/sim_structure_probleme_economique.h | 2 +- src/solver/simulation/sim_calcul_economique.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index fff1e76b6e..1261077c0b 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -302,7 +302,7 @@ struct ENERGIES_ET_PUISSANCES_HYDRAULIQUES bool TurbinageEntreBornes; bool SansHeuristique; - bool SuiviNiveauHoraire; + const bool SuiviNiveauHoraire = true; std::vector NiveauHoraireSup; std::vector NiveauHoraireInf; diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index 05183608d6..bc45b3048b 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -185,17 +185,11 @@ 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].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; } From 8c4508ba5a5f5c0889d05f29bb4064a8bffc0557 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:17:02 +0200 Subject: [PATCH 15/28] Remove unused class computeTimeStepLevel --- .../sim_structure_probleme_economique.h | 66 ------------------- 1 file changed, 66 deletions(-) diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index 1261077c0b..506357e35e 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -324,72 +324,6 @@ struct ENERGIES_ET_PUISSANCES_HYDRAULIQUES bounding constraint on final level*/ }; -class computeTimeStepLevel -{ -private: - int step; - double level; - - double capacity; - std::vector& inflows; - std::vector& ovf; - std::vector& turb; - double pumpRatio; - std::vector& pump; - double excessDown; - -public: - computeTimeStepLevel(const double& startLvl, - std::vector& infl, - std::vector& overfl, - std::vector& H, - double pumpEff, - std::vector& 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] - ovf[step]; - - if (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 ReserveHoraireJMoins1; From 606fde2bd53f4a65848aefdcbebabc0bbe85851e Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 11:25:30 +0200 Subject: [PATCH 16/28] Post-merge --- src/CMakeLists.txt | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6422fe62f1..54e0de87d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -194,47 +194,6 @@ if (${BUILD_MERSENNE_TWISTER_PYBIND11}) find_package(pybind11 REQUIRED) endif() -#Define install directory -if (NOT DEPS_INSTALL_DIR) - SET(DEPS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../rte-antares-deps-${CMAKE_BUILD_TYPE}) - -else() - if(NOT IS_ABSOLUTE ${DEPS_INSTALL_DIR}) - SET(DEPS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../${DEPS_INSTALL_DIR}) - endif() -endif() - - -# Add DEPS_INSTALL_DIR with antares-xpansion CMAKE_BUILD_TYPE -if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") - - string(REPLACE ${CMAKE_BUILD_TYPE} Release - DEPS_INSTALL_DIR_XPANSION - ${DEPS_INSTALL_DIR}) - - list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR_XPANSION}) - -elseif("${CMAKE_BUILD_TYPE}" STREQUAL "debug") - - string(REPLACE ${CMAKE_BUILD_TYPE} Debug - DEPS_INSTALL_DIR_XPANSION - ${DEPS_INSTALL_DIR}) - - list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR_XPANSION}) - -endif() - -list(APPEND CMAKE_PREFIX_PATH ${DEPS_INSTALL_DIR}) -message(STATUS "CMAKE_PREFIX_PATH : ${CMAKE_PREFIX_PATH}") - -# Build Needed dependencies -add_subdirectory(antares-deps) - -#Add needed definition in case of external dependencies compilation -include (antares-deps/cmake/additionnal-definitions.cmake) - -set(Boost_LIB_PREFIX "lib") -set(Boost_DEBUG 1) #Boost header libraries find_package(Boost REQUIRED) From ba54eed55f943cdf1bd19680e0abfc45eebd631a Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 13:03:15 +0200 Subject: [PATCH 17/28] Remove forgotten HydroLevelsUpdatePostProcessCmd --- .../adequacy_patch_csr/adq_patch_post_process_list.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp b/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp index 4ee0f5d7df..97ccaafae8 100644 --- a/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp +++ b/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp @@ -50,8 +50,6 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP // Here a post process particular to adq patch post_process_list.push_back( std::make_unique(problemeHebdo_, areas, thread_number)); - post_process_list.push_back( - std::make_unique(problemeHebdo_, areas, true, false)); post_process_list.push_back( std::make_unique(problemeHebdo_, areas, calendar)); post_process_list.push_back( From 69d4ef731bba9d4c918e562bbe038b0f99feda17 Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 16:56:51 +0200 Subject: [PATCH 18/28] Fix --- .../optimisation/opt_decompte_variables_et_contraintes.cpp | 6 ------ .../solver/simulation/sim_structure_probleme_economique.h | 2 +- src/solver/simulation/sim_calcul_economique.cpp | 2 ++ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp b/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp index 1f773bb9ea..fc857cdd82 100644 --- a/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp +++ b/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp @@ -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 diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index 506357e35e..65b16ead38 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -302,7 +302,7 @@ struct ENERGIES_ET_PUISSANCES_HYDRAULIQUES bool TurbinageEntreBornes; bool SansHeuristique; - const bool SuiviNiveauHoraire = true; + bool SuiviNiveauHoraire; std::vector NiveauHoraireSup; std::vector NiveauHoraireInf; diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index bc45b3048b..1204065ade 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -185,6 +185,8 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study, .useHeuristicTarget || area.hydro.useLeeway); + problem.CaracteristiquesHydrauliques[i].SuiviNiveauHoraire = area.hydro.reservoirManagement; + problem.CaracteristiquesHydrauliques[i].DirectLevelAccess = false; problem.CaracteristiquesHydrauliques[i].AccurateWaterValue = false; if (problem.WaterValueAccurate && area.hydro.useWaterValue) From 792b1f6a80e36527dabd45b2eb09e3381b4d97a3 Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 20:47:24 +0200 Subject: [PATCH 19/28] Cout de remplissage --- .../study/include/antares/study/parts/hydro/container.h | 1 + src/libs/antares/study/parts/hydro/container.cpp | 8 +++++++- .../solver/simulation/sim_structure_probleme_economique.h | 1 + src/solver/simulation/sim_alloc_probleme_hebdo.cpp | 1 + src/solver/simulation/sim_calcul_economique.cpp | 1 + 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libs/antares/study/include/antares/study/parts/hydro/container.h b/src/libs/antares/study/include/antares/study/parts/hydro/container.h index 8b8533da8c..b7a2c3c5b0 100644 --- a/src/libs/antares/study/include/antares/study/parts/hydro/container.h +++ b/src/libs/antares/study/include/antares/study/parts/hydro/container.h @@ -225,6 +225,7 @@ class PartHydro std::vector> deltaBetweenFinalAndInitialLevels; double overflowCost = 0.; + double levelCost = 0.; private: static bool checkReservoirLevels(const Study& study); diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index 06cb68ec1e..7e902ffa5f 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -509,6 +509,7 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder) IniFile::Section* sLeewayUp; IniFile::Section* spumpingEfficiency; IniFile::Section* sOverflowCost; + IniFile::Section* sLevelCost; AllSections(IniFile& ini): s(ini.addSection("inter-daily-breakdown")), @@ -526,7 +527,8 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder) sLeewayLow(ini.addSection("leeway low")), sLeewayUp(ini.addSection("leeway up")), spumpingEfficiency(ini.addSection("pumping efficiency")), - sOverflowCost(ini.addSection("overflow cost")) + sOverflowCost(ini.addSection("overflow cost")), + sLevelCost(ini.addSection("level cost")) { } }; @@ -586,6 +588,10 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder) { allSections.sOverflowCost->add(area.id, area.hydro.overflowCost); } + if (area.hydro.levelCost) + { + allSections.sLevelCost->add(area.id, area.hydro.overflowCost); + } // max hours gen buffer.clear() << folder << SEP << "common" << SEP << "capacity" << SEP diff --git a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h index 65b16ead38..45b82933f1 100644 --- a/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h +++ b/src/solver/simulation/include/antares/solver/simulation/sim_structure_probleme_economique.h @@ -429,6 +429,7 @@ struct PROBLEME_HEBDO std::vector CoutDeDefaillanceEnReserve; std::vector CoutDeDebordement; + std::vector CoutDeRemplissage; std::vector PaliersThermiquesDuPays; std::vector CaracteristiquesHydrauliques; diff --git a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp index 7d13891ec9..5abc2f93d6 100644 --- a/src/solver/simulation/sim_alloc_probleme_hebdo.cpp +++ b/src/solver/simulation/sim_alloc_probleme_hebdo.cpp @@ -87,6 +87,7 @@ void SIM_AllocationProblemeDonneesGenerales(PROBLEME_HEBDO& problem, problem.CoutDeDefaillanceEnReserve.assign(nbPays, 0); problem.CoutDeDebordement.assign(nbPays, 0); + problem.CoutDeRemplissage.assign(nbPays, 0); problem.NumeroDeContrainteEnergieHydraulique.assign(nbPays, 0); problem.NumeroDeContrainteMinEnergieHydraulique.assign(nbPays, 0); diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index 1204065ade..f4b3f2f8c9 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -153,6 +153,7 @@ void SIM_InitialisationProblemeHebdo(Data::Study& study, problem.CoutDeDefaillanceNegative[i] = area.thermal.spilledEnergyCost; problem.CoutDeDebordement[i] = area.hydro.overflowCost; + problem.CoutDeRemplissage[i] = area.hydro.levelCost; problem.CoutDeDefaillanceEnReserve[i] = area.thermal.unsuppliedEnergyCost; From f04faf9896be04f11302b163cac1c8fa66f9f47a Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 21:38:42 +0200 Subject: [PATCH 20/28] Counting --- .../opt_decompte_variables_et_contraintes.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp b/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp index fc857cdd82..f912cc9da3 100644 --- a/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp +++ b/src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp @@ -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; + + if (Pump && !TurbEntreBornes) { ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall energy generated over the period (10a in @@ -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++; @@ -170,7 +170,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* ProblemeAResoudre->NombreDeContraintes++; } - if (!Pump && TurbEntreBornes && MonitorHourlyLev) + if (!Pump && TurbEntreBornes) { ProblemeAResoudre->NombreDeContraintes++; @@ -179,7 +179,7 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO* ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation; } - if (Pump && TurbEntreBornes && MonitorHourlyLev) + if (Pump && TurbEntreBornes) { ProblemeAResoudre->NombreDeContraintes++; @@ -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 From 0f1e82b5188c414e57560530e37fde8a7ca603f9 Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 21:40:50 +0200 Subject: [PATCH 21/28] Re-introduce computingHydroLevels, only for scaling This reverts commit ac97a130974db05179489ccf14f3eefde7948d27. --- .../adq_patch_post_process_list.cpp | 3 +- .../optimisation/post_process_commands.h | 15 +++++++ .../optimisation/optim_post_process_list.cpp | 6 ++- .../optimisation/post_process_commands.cpp | 19 +++++++++ src/solver/simulation/adequacy.cpp | 6 +++ src/solver/simulation/common-hydro-levels.cpp | 42 ++++++++++++++++--- .../solver/simulation/common-eco-adq.h | 12 ++++++ 7 files changed, 95 insertions(+), 8 deletions(-) diff --git a/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp b/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp index 97ccaafae8..248053a4c3 100644 --- a/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp +++ b/src/solver/optimisation/adequacy_patch_csr/adq_patch_post_process_list.cpp @@ -41,7 +41,8 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP problemeHebdo_, areas, thread_number_)); - + post_process_list.push_back( + std::make_unique(problemeHebdo_, areas, false, false)); post_process_list.push_back(std::make_unique(problemeHebdo_, areas, sheddingPolicy, diff --git a/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h b/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h index 0ac7d732bd..5bf5ecf314 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h @@ -37,6 +37,21 @@ class DispatchableMarginPostProcessCmd: public basePostProcessCommand const AreaList& area_list_; }; +class HydroLevelsUpdatePostProcessCmd: public basePostProcessCommand +{ +public: + HydroLevelsUpdatePostProcessCmd(PROBLEME_HEBDO* problemeHebdo, + AreaList& areas, + bool remixWasRun, + bool computeAnyway); + void execute(const optRuntimeData& opt_runtime_data) override; + +private: + const AreaList& area_list_; + bool remixWasRun_ = false; + bool computeAnyway_ = false; +}; + class RemixHydroPostProcessCmd: public basePostProcessCommand { public: diff --git a/src/solver/optimisation/optim_post_process_list.cpp b/src/solver/optimisation/optim_post_process_list.cpp index baceb7f9d6..a9eb38f7e8 100644 --- a/src/solver/optimisation/optim_post_process_list.cpp +++ b/src/solver/optimisation/optim_post_process_list.cpp @@ -37,13 +37,15 @@ OptPostProcessList::OptPostProcessList(PROBLEME_HEBDO* problemeHebdo, { post_process_list.push_back( std::make_unique(problemeHebdo_, thread_number_, areas)); - + post_process_list.push_back( + std::make_unique(problemeHebdo_, areas, false, false)); post_process_list.push_back(std::make_unique(problemeHebdo_, areas, sheddingPolicy, splxOptimization, thread_number)); - + post_process_list.push_back( + std::make_unique(problemeHebdo_, areas, true, false)); post_process_list.push_back( std::make_unique(problemeHebdo_, areas, calendar)); post_process_list.push_back( diff --git a/src/solver/optimisation/post_process_commands.cpp b/src/solver/optimisation/post_process_commands.cpp index e8e6b5554a..7ca5a4b0d5 100644 --- a/src/solver/optimisation/post_process_commands.cpp +++ b/src/solver/optimisation/post_process_commands.cpp @@ -70,6 +70,25 @@ void DispatchableMarginPostProcessCmd::execute(const optRuntimeData& opt_runtime }); } +// ----------------------------- +// Hydro levels update +// ----------------------------- +HydroLevelsUpdatePostProcessCmd::HydroLevelsUpdatePostProcessCmd(PROBLEME_HEBDO* problemeHebdo, + AreaList& areas, + bool remixWasRun, + bool computeAnyway): + basePostProcessCommand(problemeHebdo), + area_list_(areas), + remixWasRun_(remixWasRun), + computeAnyway_(computeAnyway) +{ +} + +void HydroLevelsUpdatePostProcessCmd::execute(const optRuntimeData&) +{ + computingHydroLevels(area_list_, *problemeHebdo_, remixWasRun_, computeAnyway_); +} + // ----------------------------- // Remix Hydro // ----------------------------- diff --git a/src/solver/simulation/adequacy.cpp b/src/solver/simulation/adequacy.cpp index d98a24d256..e0ef154020 100644 --- a/src/solver/simulation/adequacy.cpp +++ b/src/solver/simulation/adequacy.cpp @@ -214,12 +214,16 @@ bool Adequacy::year(Progression::Task& progression, resultWriter, simulationObserver_.get()); + computingHydroLevels(study.areas, currentProblem, false); + RemixHydroForAllAreas(study.areas, currentProblem, study.parameters.shedding.policy, study.parameters.simplexOptimizationRange, numSpace, hourInTheYear); + + computingHydroLevels(study.areas, currentProblem, true); } catch (Data::AssertionError& ex) { @@ -324,6 +328,8 @@ bool Adequacy::year(Progression::Task& progression, .ConsommationAbattueDuPays[k]; } } + + computingHydroLevels(study.areas, currentProblem, false, true); } interpolateWaterValue(study.areas, currentProblem, study.calendar, hourInTheYear); diff --git a/src/solver/simulation/common-hydro-levels.cpp b/src/solver/simulation/common-hydro-levels.cpp index 3694da72f7..1f0d05e4be 100644 --- a/src/solver/simulation/common-hydro-levels.cpp +++ b/src/solver/simulation/common-hydro-levels.cpp @@ -28,6 +28,35 @@ namespace Antares::Solver::Simulation { using Constants::nbHoursInAWeek; +void computingHydroLevels(const Data::AreaList& areas, + PROBLEME_HEBDO& problem, + bool remixWasRun, + bool computeAnyway) +{ + for (const auto& [_, area]: areas) + { + if (!area->hydro.reservoirManagement) + { + continue; + } + + if (!computeAnyway && area->hydro.useHeuristicTarget != remixWasRun) + { + continue; + } + + uint index = area->index; + + double reservoirCapacity = area->hydro.reservoirCapacity; + RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index]; + std::vector& niv = weeklyResults.niveauxHoraires; + for (uint h = 0; h < nbHoursInAWeek; h++) + { + niv[h] = niv[h] * 100 / reservoirCapacity; + } + } +} + void interpolateWaterValue(const Data::AreaList& areas, PROBLEME_HEBDO& problem, const Date::Calendar& calendar, @@ -64,7 +93,7 @@ void interpolateWaterValue(const Data::AreaList& areas, double reservoirCapacity = area->hydro.reservoirCapacity; - const std::vector& niv = weeklyResults.niveauxHoraires; + std::vector& niv = weeklyResults.niveauxHoraires; waterVal[0] = Data::getWaterValue(problem.previousSimulationFinalLevel[index] * 100 / reservoirCapacity, @@ -89,11 +118,14 @@ void updatingWeeklyFinalHydroLevel(const Data::AreaList& areas, PROBLEME_HEBDO& continue; } - const double reservoirCapacity = area->hydro.reservoirCapacity; + uint index = area->index; + + double reservoirCapacity = area->hydro.reservoirCapacity; + + RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index]; + + std::vector& niv = weeklyResults.niveauxHoraires; - const uint index = area->index; - const RESULTATS_HORAIRES& weeklyResults = problem.ResultatsHoraires[index]; - const std::vector& niv = weeklyResults.niveauxHoraires; problem.previousSimulationFinalLevel[index] = niv[nbHoursInAWeek - 1] * reservoirCapacity / 100; } diff --git a/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h b/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h index 8f89b4998a..6a4dabd763 100644 --- a/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h +++ b/src/solver/simulation/include/antares/solver/simulation/common-eco-adq.h @@ -95,6 +95,18 @@ void RemixHydroForAllAreas(const Data::AreaList& areas, uint numSpace, uint hourInYear); +/* +** \brief Computing levels from hydro generation, natural and pumping inflows +** +** If hydro remix was not done yet, levels are computed only for areas for which we do not use the +*heuristic +** If hydro remix was done, levels are computed only for areas for which we use the heuristic +*/ +void computingHydroLevels(const Data::AreaList& areas, + PROBLEME_HEBDO& problem, + bool remixWasRun, + bool computeAnyway = false); + /* ** \brief Interpolates water values related to reservoir levels for outputs only ** From 424540707e743c5b3c725034dfac37e951e9ba26 Mon Sep 17 00:00:00 2001 From: OMNES Florian Date: Thu, 12 Sep 2024 21:43:50 +0200 Subject: [PATCH 22/28] CoutDeRemplissage --- src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp index 9457d5cae4..fdace13357 100644 --- a/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_couts_cas_lineaire.cpp @@ -287,7 +287,7 @@ void OPT_InitialiserLesCoutsLineaire(PROBLEME_HEBDO* problemeHebdo, 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); From 0b08645e8e8d1504b6d3a2fc703d1cae2b59da6d Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Fri, 13 Sep 2024 14:12:36 +0200 Subject: [PATCH 23/28] Fix --- src/libs/antares/study/parts/hydro/container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index 7e902ffa5f..d7beec8684 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -590,7 +590,7 @@ bool PartHydro::SaveToFolder(const AreaList& areas, const AnyString& folder) } if (area.hydro.levelCost) { - allSections.sLevelCost->add(area.id, area.hydro.overflowCost); + allSections.sLevelCost->add(area.id, area.hydro.levelCost); } // max hours gen From 53bdf5fc2b2ed19f2ead758c12c37fb6d8124430 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Fri, 13 Sep 2024 16:35:30 +0200 Subject: [PATCH 24/28] Disable some tests --- .github/workflows/ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2c73097adb..231f5ec7e4 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -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 From a67c0894d4b852b4d17658c7cddeca5b25981eb4 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:15:57 +0200 Subject: [PATCH 25/28] Add reset for levelCost --- src/libs/antares/study/parts/hydro/container.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index d7beec8684..63ed40c8e8 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -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); @@ -89,8 +91,6 @@ void PartHydro::reset() allocation.clear(); // allocation.fromArea(, 1.); // Area::reset() - overflowCost = 0.; - if (prepro) { prepro->reset(); From 4189a3e9688c6059a6fda957d9d088a55afc1640 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:20:47 +0200 Subject: [PATCH 26/28] Add load for levelCost --- src/libs/antares/study/parts/hydro/container.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index 63ed40c8e8..1a31a2b85c 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -338,6 +338,11 @@ bool PartHydro::LoadFromFolder(Study& study, const AnyString& folder) && ret; } + if (IniFile::Section* section = ini.find("level cost")) + { + ret = loadProperties(study, section->firstProperty, buffer, &PartHydro::levelCost) && ret; + } + return ret; } From 3808849c1b4c292ac53ed7ea358c18600dbca24b Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:25:33 +0100 Subject: [PATCH 27/28] Fix build --- src/libs/antares/study/parts/hydro/container.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/antares/study/parts/hydro/container.cpp b/src/libs/antares/study/parts/hydro/container.cpp index adc3269f2f..73c8dc7bd4 100644 --- a/src/libs/antares/study/parts/hydro/container.cpp +++ b/src/libs/antares/study/parts/hydro/container.cpp @@ -328,13 +328,12 @@ bool PartHydro::LoadFromFolder(Study& study, const fs::path& folder) if (IniFile::Section* section = ini.find("overflow cost")) { - ret = loadProperties(study, section->firstProperty, buffer, &PartHydro::overflowCost) - && ret; + ret = loadProperties(study, section->firstProperty, path, &PartHydro::overflowCost) && ret; } if (IniFile::Section* section = ini.find("level cost")) { - ret = loadProperties(study, section->firstProperty, buffer, &PartHydro::levelCost) && ret; + ret = loadProperties(study, section->firstProperty, path, &PartHydro::levelCost) && ret; } return ret; From b99e64b8c4f039b7c3f2d6f61de53cfbf76cb4b3 Mon Sep 17 00:00:00 2001 From: Juliette-Gerbaux <130555142+Juliette-Gerbaux@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:06:36 +0000 Subject: [PATCH 28/28] Remove truncation --- src/solver/simulation/sim_calcul_economique.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index e78b0633ee..a6a2785334 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -850,11 +850,7 @@ void SIM_RenseignementProblemeHebdo(const Study& study, marginGen = weekGenerationTarget; - if (problem.CaracteristiquesHydrauliques[k].NiveauInitialReservoir - < weekTarget_tmp) - { - marginGen = problem.CaracteristiquesHydrauliques[k].NiveauInitialReservoir; - } + } if (not problem.CaracteristiquesHydrauliques[k].TurbinageEntreBornes)