Skip to content

Commit

Permalink
Remove StudyRuntimeInfos::parameters (#1665)
Browse files Browse the repository at this point in the history
* Remove StudyRuntimeInfos::parameters

* Fix build
  • Loading branch information
flomnes authored Oct 2, 2023
1 parent 1fa52a8 commit 8113212
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/libs/antares/study/runtime/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -247,7 +247,6 @@ void StudyRuntimeInfos::initializeRangeLimits(const Study& study, StudyRangeLimi

StudyRuntimeInfos::StudyRuntimeInfos() :
nbYears(0),
parameters(nullptr),
thermalPlantTotalCount(0),
thermalPlantTotalCountMustRun(0),
quadraticOptimizationHasFailed(false)
Expand All @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions src/libs/antares/study/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ class StudyRuntimeInfos
//! The number of years to process
uint nbYears;

//! Alias for General data
Parameters* parameters;

//! Range limits
StudyRangeLimits rangeLimits;

Expand Down
9 changes: 3 additions & 6 deletions src/solver/simulation/solver.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,9 @@ void ISimulation<Impl>::run()
ImplementationType::variables.template provideInformations<Variable::PrintInfosStdCout>(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;
Expand Down Expand Up @@ -347,7 +344,7 @@ void ISimulation<Impl>::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
Expand Down Expand Up @@ -416,7 +413,7 @@ void ISimulation<Impl>::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.";
Expand Down
2 changes: 1 addition & 1 deletion src/solver/ts-generator/hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8113212

Please sign in to comment.