From cb75161e28a19a12577c194684b1f8ede554e00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Omn=C3=A8s?= Date: Wed, 11 Sep 2024 15:19:41 +0200 Subject: [PATCH] Remove unused adqPatchParams argument, class member (#2390) This follows the removal of the "adequacy patch - local matching" feature. --- .../adequacy_patch_csr/adq_patch_post_process_list.cpp | 5 +---- .../include/antares/solver/optimisation/opt_fonctions.h | 4 ---- .../antares/solver/optimisation/post_process_commands.h | 4 +--- .../antares/solver/optimisation/weekly_optimization.h | 2 -- .../optimisation/opt_gestion_des_bornes_cas_lineaire.cpp | 3 --- src/solver/optimisation/opt_optimisation_hebdo.cpp | 7 +------ src/solver/optimisation/opt_optimisation_lineaire.cpp | 5 ----- .../optimisation/opt_pilotage_optimisation_lineaire.cpp | 7 +------ src/solver/optimisation/post_process_commands.cpp | 2 -- src/solver/optimisation/weekly_optimization.cpp | 8 +------- src/solver/simulation/adequacy.cpp | 1 - src/solver/simulation/common-eco-adq.cpp | 1 - src/solver/simulation/economy.cpp | 1 - 13 files changed, 5 insertions(+), 45 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..ca3a31ecb0 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,10 +50,7 @@ AdqPatchPostProcessList::AdqPatchPostProcessList(const AdqPatchParams& adqPatchP thread_number)); // Here a post process particular to adq patch post_process_list.push_back( - std::make_unique(adqPatchParams, - problemeHebdo_, - areas, - thread_number)); + std::make_unique(problemeHebdo_, areas, thread_number)); post_process_list.push_back( std::make_unique(problemeHebdo_, areas, true, false)); post_process_list.push_back( diff --git a/src/solver/optimisation/include/antares/solver/optimisation/opt_fonctions.h b/src/solver/optimisation/include/antares/solver/optimisation/opt_fonctions.h index 4be6b8e1d7..5a2aead56f 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/opt_fonctions.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/opt_fonctions.h @@ -36,7 +36,6 @@ using OptimizationOptions = Antares::Solver::Optimization::OptimizationOptions; void OPT_OptimisationHebdomadaire(const OptimizationOptions& options, PROBLEME_HEBDO* pProblemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, Solver::Simulation::ISimulationObserver& simulationObserver); void OPT_NumeroDeJourDuPasDeTemps(PROBLEME_HEBDO*); @@ -47,7 +46,6 @@ void OPT_InitialiserLesPminHebdo(PROBLEME_HEBDO*); void OPT_InitialiserLesContrainteDEnergieHydrauliqueParIntervalleOptimise(PROBLEME_HEBDO*); void OPT_MaxDesPmaxHydrauliques(PROBLEME_HEBDO*); void OPT_InitialiserLesBornesDesVariablesDuProblemeLineaire(PROBLEME_HEBDO*, - const AdqPatchParams&, const int, const int, const int); @@ -68,7 +66,6 @@ bool ADQ_PATCH_CSR(PROBLEME_ANTARES_A_RESOUDRE&, bool OPT_PilotageOptimisationLineaire(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, Solver::Simulation::ISimulationObserver& simulationObserver); void OPT_VerifierPresenceReserveJmoins1(PROBLEME_HEBDO*); @@ -89,7 +86,6 @@ void OPT_LiberationProblemesSimplexe(const OptimizationOptions& options, const P bool OPT_OptimisationLineaire(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, Solver::Simulation::ISimulationObserver& simulationObserver); void OPT_RestaurerLesDonnees(PROBLEME_HEBDO*); 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..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 @@ -74,15 +74,13 @@ class DTGmarginForAdqPatchPostProcessCmd: public basePostProcessCommand using AdqPatchParams = Antares::Data::AdequacyPatch::AdqPatchParams; public: - DTGmarginForAdqPatchPostProcessCmd(const AdqPatchParams& adqPatchParams, - PROBLEME_HEBDO* problemeHebdo, + DTGmarginForAdqPatchPostProcessCmd(PROBLEME_HEBDO* problemeHebdo, AreaList& areas, unsigned int thread_number); void execute(const optRuntimeData& opt_runtime_data) override; private: - const AdqPatchParams& adqPatchParams_; const AreaList& area_list_; unsigned int thread_number_ = 0; }; diff --git a/src/solver/optimisation/include/antares/solver/optimisation/weekly_optimization.h b/src/solver/optimisation/include/antares/solver/optimisation/weekly_optimization.h index c1f7774d5d..e86e3b9683 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/weekly_optimization.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/weekly_optimization.h @@ -32,7 +32,6 @@ class WeeklyOptimization public: WeeklyOptimization(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - Antares::Data::AdequacyPatch::AdqPatchParams&, uint numSpace, IResultWriter& writer, Simulation::ISimulationObserver& simulationObserver); @@ -41,7 +40,6 @@ class WeeklyOptimization Antares::Solver::Optimization::OptimizationOptions options_; PROBLEME_HEBDO* const problemeHebdo_ = nullptr; - Antares::Data::AdequacyPatch::AdqPatchParams& adqPatchParams_; const uint thread_number_ = 0; IResultWriter& writer_; std::reference_wrapper simulationObserver_; 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..3b9eb9132a 100644 --- a/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp +++ b/src/solver/optimisation/opt_gestion_des_bornes_cas_lineaire.cpp @@ -79,7 +79,6 @@ double OPT_SommeDesPminThermiques(const PROBLEME_HEBDO* problemeHebdo, int Pays, } void setBoundsForUnsuppliedEnergy(PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, const int PremierPdtDeLIntervalle, const int DernierPdtDeLIntervalle, const int optimizationNumber) @@ -205,7 +204,6 @@ static void setBoundsForShortTermStorage(PROBLEME_HEBDO* problemeHebdo, } void OPT_InitialiserLesBornesDesVariablesDuProblemeLineaire(PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, const int PremierPdtDeLIntervalle, const int DernierPdtDeLIntervalle, const int optimizationNumber) @@ -459,7 +457,6 @@ void OPT_InitialiserLesBornesDesVariablesDuProblemeLineaire(PROBLEME_HEBDO* prob } setBoundsForUnsuppliedEnergy(problemeHebdo, - adqPatchParams, PremierPdtDeLIntervalle, DernierPdtDeLIntervalle, optimizationNumber); diff --git a/src/solver/optimisation/opt_optimisation_hebdo.cpp b/src/solver/optimisation/opt_optimisation_hebdo.cpp index 0abed9ff13..d5d3abb5b2 100644 --- a/src/solver/optimisation/opt_optimisation_hebdo.cpp +++ b/src/solver/optimisation/opt_optimisation_hebdo.cpp @@ -39,17 +39,12 @@ using Antares::Solver::Optimization::OptimizationOptions; void OPT_OptimisationHebdomadaire(const OptimizationOptions& options, PROBLEME_HEBDO* pProblemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, Solver::Simulation::ISimulationObserver& simulationObserver) { if (pProblemeHebdo->TypeDOptimisation == OPTIMISATION_LINEAIRE) { - if (!OPT_PilotageOptimisationLineaire(options, - pProblemeHebdo, - adqPatchParams, - writer, - simulationObserver)) + if (!OPT_PilotageOptimisationLineaire(options, pProblemeHebdo, writer, simulationObserver)) { logs.error() << "Linear optimization failed"; throw UnfeasibleProblemError("Linear optimization failed"); diff --git a/src/solver/optimisation/opt_optimisation_lineaire.cpp b/src/solver/optimisation/opt_optimisation_lineaire.cpp index b3ca1a3daa..8ff621b612 100644 --- a/src/solver/optimisation/opt_optimisation_lineaire.cpp +++ b/src/solver/optimisation/opt_optimisation_lineaire.cpp @@ -80,7 +80,6 @@ void notifyProblemHebdo(const PROBLEME_HEBDO* problemeHebdo, bool runWeeklyOptimization(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, int optimizationNumber, Solver::Simulation::ISimulationObserver& simulationObserver) @@ -96,7 +95,6 @@ bool runWeeklyOptimization(const OptimizationOptions& options, DernierPdtDeLIntervalle = pdtHebdo + NombreDePasDeTempsPourUneOptimisation; OPT_InitialiserLesBornesDesVariablesDuProblemeLineaire(problemeHebdo, - adqPatchParams, PremierPdtDeLIntervalle, DernierPdtDeLIntervalle, optimizationNumber); @@ -190,7 +188,6 @@ void resizeProbleme(PROBLEME_ANTARES_A_RESOUDRE* ProblemeAResoudre, bool OPT_OptimisationLineaire(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, Solver::Simulation::ISimulationObserver& simulationObserver) { @@ -226,7 +223,6 @@ bool OPT_OptimisationLineaire(const OptimizationOptions& options, bool ret = runWeeklyOptimization(options, problemeHebdo, - adqPatchParams, writer, PREMIERE_OPTIMISATION, simulationObserver); @@ -240,7 +236,6 @@ bool OPT_OptimisationLineaire(const OptimizationOptions& options, runThermalHeuristic(problemeHebdo); return runWeeklyOptimization(options, problemeHebdo, - adqPatchParams, writer, DEUXIEME_OPTIMISATION, simulationObserver); diff --git a/src/solver/optimisation/opt_pilotage_optimisation_lineaire.cpp b/src/solver/optimisation/opt_pilotage_optimisation_lineaire.cpp index 7d6bff0d80..669b2943c9 100644 --- a/src/solver/optimisation/opt_pilotage_optimisation_lineaire.cpp +++ b/src/solver/optimisation/opt_pilotage_optimisation_lineaire.cpp @@ -29,7 +29,6 @@ using Antares::Solver::Optimization::OptimizationOptions; bool OPT_PilotageOptimisationLineaire(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - const AdqPatchParams& adqPatchParams, Solver::IResultWriter& writer, Solver::Simulation::ISimulationObserver& simulationObserver) { @@ -77,9 +76,5 @@ bool OPT_PilotageOptimisationLineaire(const OptimizationOptions& options, OPT_InitialiserNombreMinEtMaxDeGroupesCoutsDeDemarrage(problemeHebdo); } - return OPT_OptimisationLineaire(options, - problemeHebdo, - adqPatchParams, - writer, - simulationObserver); + return OPT_OptimisationLineaire(options, problemeHebdo, writer, simulationObserver); } diff --git a/src/solver/optimisation/post_process_commands.cpp b/src/solver/optimisation/post_process_commands.cpp index fb628d694d..7ca5a4b0d5 100644 --- a/src/solver/optimisation/post_process_commands.cpp +++ b/src/solver/optimisation/post_process_commands.cpp @@ -122,12 +122,10 @@ void RemixHydroPostProcessCmd::execute(const optRuntimeData& opt_runtime_data) using namespace Antares::Data::AdequacyPatch; DTGmarginForAdqPatchPostProcessCmd::DTGmarginForAdqPatchPostProcessCmd( - const AdqPatchParams& adqPatchParams, PROBLEME_HEBDO* problemeHebdo, AreaList& areas, unsigned int thread_number): basePostProcessCommand(problemeHebdo), - adqPatchParams_(adqPatchParams), area_list_(areas), thread_number_(thread_number) { diff --git a/src/solver/optimisation/weekly_optimization.cpp b/src/solver/optimisation/weekly_optimization.cpp index 0cf6ec84cd..8546263b13 100644 --- a/src/solver/optimisation/weekly_optimization.cpp +++ b/src/solver/optimisation/weekly_optimization.cpp @@ -27,13 +27,11 @@ namespace Antares::Solver::Optimization { WeeklyOptimization::WeeklyOptimization(const OptimizationOptions& options, PROBLEME_HEBDO* problemeHebdo, - AdqPatchParams& adqPatchParams, uint thread_number, IResultWriter& writer, Simulation::ISimulationObserver& simulationObserver): options_(options), problemeHebdo_(problemeHebdo), - adqPatchParams_(adqPatchParams), thread_number_(thread_number), writer_(writer), simulationObserver_(simulationObserver) @@ -42,11 +40,7 @@ WeeklyOptimization::WeeklyOptimization(const OptimizationOptions& options, void WeeklyOptimization::solve() { - OPT_OptimisationHebdomadaire(options_, - problemeHebdo_, - adqPatchParams_, - writer_, - simulationObserver_.get()); + OPT_OptimisationHebdomadaire(options_, problemeHebdo_, writer_, simulationObserver_.get()); } } // namespace Antares::Solver::Optimization diff --git a/src/solver/simulation/adequacy.cpp b/src/solver/simulation/adequacy.cpp index eed49029e8..e0ef154020 100644 --- a/src/solver/simulation/adequacy.cpp +++ b/src/solver/simulation/adequacy.cpp @@ -211,7 +211,6 @@ bool Adequacy::year(Progression::Task& progression, { OPT_OptimisationHebdomadaire(createOptimizationOptions(study), ¤tProblem, - study.parameters.adqPatchParams, resultWriter, simulationObserver_.get()); diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index bfc697372a..c9a9039ab6 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -94,7 +94,6 @@ static void RecalculDesEchangesMoyens(Data::Study& study, NullSimulationObserver simulationObserver; OPT_OptimisationHebdomadaire(createOptimizationOptions(study), &problem, - study.parameters.adqPatchParams, resultWriter, simulationObserver); } diff --git a/src/solver/simulation/economy.cpp b/src/solver/simulation/economy.cpp index 4499c339dc..5e97ccc192 100644 --- a/src/solver/simulation/economy.cpp +++ b/src/solver/simulation/economy.cpp @@ -85,7 +85,6 @@ bool Economy::simulationBegin() weeklyOptProblems_.emplace_back(options, &pProblemesHebdo[numSpace], - study.parameters.adqPatchParams, numSpace, resultWriter, simulationObserver_.get());