From 81132124db213d2b7f418248b629e6520a92de48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Omn=C3=A8s?= Date: Mon, 2 Oct 2023 16:51:33 +0200 Subject: [PATCH] Remove `StudyRuntimeInfos::parameters` (#1665) * Remove StudyRuntimeInfos::parameters * Fix build --- src/libs/antares/study/runtime/runtime.cpp | 4 +--- src/libs/antares/study/runtime/runtime.h | 3 --- src/solver/simulation/solver.hxx | 9 +++------ src/solver/ts-generator/hydro.cpp | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/libs/antares/study/runtime/runtime.cpp b/src/libs/antares/study/runtime/runtime.cpp index bb2fa4383c..0a8f349847 100644 --- a/src/libs/antares/study/runtime/runtime.cpp +++ b/src/libs/antares/study/runtime/runtime.cpp @@ -82,7 +82,7 @@ static void StudyRuntimeInfosInitializeAllAreas(Study& study, StudyRuntimeInfos& } // Spinning - Economic Only - If no prepro - if (!(timeSeriesThermal & r.parameters->timeSeriesToRefresh)) + if (!(timeSeriesThermal & study.parameters.timeSeriesToRefresh)) { // Calculation of the spinning area.thermal.list.calculationOfSpinning(); @@ -247,7 +247,6 @@ void StudyRuntimeInfos::initializeRangeLimits(const Study& study, StudyRangeLimi StudyRuntimeInfos::StudyRuntimeInfos() : nbYears(0), - parameters(nullptr), thermalPlantTotalCount(0), thermalPlantTotalCountMustRun(0), quadraticOptimizationHasFailed(false) @@ -274,7 +273,6 @@ bool StudyRuntimeInfos::loadFromStudy(Study& study) auto& gd = study.parameters; nbYears = gd.nbYears; - parameters = &study.parameters; mode = gd.mode; thermalPlantTotalCount = 0; thermalPlantTotalCountMustRun = 0; diff --git a/src/libs/antares/study/runtime/runtime.h b/src/libs/antares/study/runtime/runtime.h index 33e78f3c20..a499f47483 100644 --- a/src/libs/antares/study/runtime/runtime.h +++ b/src/libs/antares/study/runtime/runtime.h @@ -92,9 +92,6 @@ class StudyRuntimeInfos //! The number of years to process uint nbYears; - //! Alias for General data - Parameters* parameters; - //! Range limits StudyRangeLimits rangeLimits; diff --git a/src/solver/simulation/solver.hxx b/src/solver/simulation/solver.hxx index 177a2147fa..00e5bc9353 100644 --- a/src/solver/simulation/solver.hxx +++ b/src/solver/simulation/solver.hxx @@ -301,12 +301,9 @@ void ISimulation::run() ImplementationType::variables.template provideInformations(c); } - // The general data - auto& parameters = *(study.runtime->parameters); - // Preprocessors // Determine if we have to use the preprocessors at least one time. - pData.initialize(parameters); + pData.initialize(study.parameters); // Prepro only ? ImplementationType::preproOnly = settings.tsGeneratorsOnly; @@ -347,7 +344,7 @@ void ISimulation::run() throw FatalError("An unrecoverable error has occured. Can not continue."); } - if (parameters.useCustomScenario) + if (study.parameters.useCustomScenario) ApplyCustomScenario(study); // Launching the simulation for all years @@ -416,7 +413,7 @@ void ISimulation::writeResults(bool synthesis, uint year, uint numSpace) { if (synthesis) { - auto& parameters = *(study.runtime->parameters); + const auto& parameters = study.parameters; if (not parameters.synthesis) // disabled by parameters { logs.info() << "The simulation synthesis is disabled."; diff --git a/src/solver/ts-generator/hydro.cpp b/src/solver/ts-generator/hydro.cpp index e3db0ea742..c554de8852 100644 --- a/src/solver/ts-generator/hydro.cpp +++ b/src/solver/ts-generator/hydro.cpp @@ -158,7 +158,7 @@ bool GenerateHydroTimeSeries(Data::Study& study, uint currentYear, IResultWriter for (uint i = 0; i != DIM; ++i) NORM[i] = 0.; - uint nbTimeseries = studyRTI.parameters->nbTimeSeriesHydro; + uint nbTimeseries = study.parameters.nbTimeSeriesHydro; PreproHydroInitMatrices(study, nbTimeseries);