diff --git a/src/libs/antares/study/runtime/runtime.cpp b/src/libs/antares/study/runtime/runtime.cpp index 3309ebadc4..753b73a976 100644 --- a/src/libs/antares/study/runtime/runtime.cpp +++ b/src/libs/antares/study/runtime/runtime.cpp @@ -246,19 +246,12 @@ void StudyRuntimeInfos::initializeRangeLimits(const Study& study, StudyRangeLimi } StudyRuntimeInfos::StudyRuntimeInfos(uint nbYearsParallel) : - nbYears(0), - parameters(nullptr), - timeseriesNumberYear(nullptr), - thermalPlantTotalCount(0), - thermalPlantTotalCountMustRun(0), - quadraticOptimizationHasFailed(false) + nbYears(0), + parameters(nullptr), + thermalPlantTotalCount(0), + thermalPlantTotalCountMustRun(0), + quadraticOptimizationHasFailed(false) { - // Evite les confusions de numeros de TS entre AMC - timeseriesNumberYear = new uint[nbYearsParallel]; - for (uint numSpace = 0; numSpace < nbYearsParallel; numSpace++) - { - timeseriesNumberYear[numSpace] = 999999; - } } void StudyRuntimeInfos::checkThermalTSGeneration(Study& study) @@ -447,8 +440,6 @@ void StudyRuntimeInfos::removeAllRenewableClustersFromSolverComputations(Study& StudyRuntimeInfos::~StudyRuntimeInfos() { logs.debug() << "Releasing runtime data"; - - delete[] timeseriesNumberYear; } #ifndef NDEBUG diff --git a/src/libs/antares/study/runtime/runtime.h b/src/libs/antares/study/runtime/runtime.h index 0b65f52d1a..f8aba658f3 100644 --- a/src/libs/antares/study/runtime/runtime.h +++ b/src/libs/antares/study/runtime/runtime.h @@ -109,14 +109,6 @@ class StudyRuntimeInfos //! Random numbers generators MersenneTwister random[seedMax]; - /*! - ** \brief The index to use when retrieving the time-series numbers - ** - ** To allow the drop of the years with no solution, we can not fully rely - ** on the current year. So we have to maintain a rotating index (0..nbYears) - */ - uint* timeseriesNumberYear; - //! Total uint thermalPlantTotalCount; uint thermalPlantTotalCountMustRun; diff --git a/src/solver/aleatoire/alea_fonctions.h b/src/solver/aleatoire/alea_fonctions.h index 33f1c10ccc..e54d825358 100644 --- a/src/solver/aleatoire/alea_fonctions.h +++ b/src/solver/aleatoire/alea_fonctions.h @@ -30,4 +30,5 @@ #include "antares/study/study.h" void ApplyRandomTSnumbers(const Antares::Data::Study& study, + unsigned int year, uint numSpace); \ No newline at end of file diff --git a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp b/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp index 04acdb83b5..b39a83fd76 100644 --- a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp +++ b/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp @@ -34,12 +34,9 @@ using namespace Antares; using namespace Antares::Data; void ApplyRandomTSnumbers(const Study& study, + unsigned int year, uint numSpace) { - auto& runtime = *study.runtime; - - uint year = runtime.timeseriesNumberYear[numSpace]; - // each area const unsigned int count = study.areas.size(); for (unsigned int areaIndex = 0; areaIndex != count; ++areaIndex) @@ -126,9 +123,9 @@ void ApplyRandomTSnumbers(const Study& study, // Transmission capacities // ------------------------------ // each link - for (unsigned int linkIndex = 0; linkIndex < runtime.interconnectionsCount(); ++linkIndex) + for (unsigned int linkIndex = 0; linkIndex < study.runtime->interconnectionsCount(); ++linkIndex) { - AreaLink* link = runtime.areaLink[linkIndex]; + AreaLink* link = study.runtime->areaLink[linkIndex]; assert(year < link->timeseriesNumbers.height); NUMERO_CHRONIQUES_TIREES_PAR_INTERCONNEXION& ptchro = NumeroChroniquesTireesParInterconnexion[numSpace][linkIndex]; diff --git a/src/solver/simulation/solver.hxx b/src/solver/simulation/solver.hxx index 434ffb349e..39db8e13ce 100644 --- a/src/solver/simulation/solver.hxx +++ b/src/solver/simulation/solver.hxx @@ -152,7 +152,7 @@ private: // 2 - Preparing the Time-series numbers // We want to draw lots of numbers for time-series - ApplyRandomTSnumbers(study, numSpace); + ApplyRandomTSnumbers(study, y, numSpace); // 3 - Preparing data related to Clusters in 'must-run' mode simulation_->prepareClustersInMustRunMode(numSpace); @@ -980,7 +980,6 @@ void ISimulation::loopThroughYears(uint firstYear, { yearPerformed = true; numSpace = set_it->performedYearToSpace[y]; - study.runtime->timeseriesNumberYear[numSpace] = y; } // If the year has not to be rerun, we skip the computation of the year.