Skip to content

Commit

Permalink
[DEV] Move hydroManagement to year job
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Nov 2, 2023
1 parent 9e994a1 commit 1b12eae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/solver/simulation/solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ class ISimulation : public Impl
uint pNbMaxPerformedYearsInParallel;
//! Year by year output results
bool pYearByYear;
//! Hydro management
HydroManagement hydroManagement;
//! Hydro hot start
bool pHydroHotStart;
//! The first set of parallel year(s) with a performed year was already run ?
Expand Down
17 changes: 9 additions & 8 deletions src/solver/simulation/solver.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ public:
state(pState),
yearByYear(pYearByYear),
pDurationCollector(durationCollector),
pResultWriter(resultWriter)
pResultWriter(resultWriter),
hydroManagement(study.areas,
study.parameters,
study.calendar,
study.maxNbYearsInParallel,
resultWriter)
{
hydroHotStart = (study.parameters.initialReservoirLevels.iniLevels == Data::irlHotStart);
}
Expand All @@ -98,6 +103,7 @@ private:
bool hydroHotStart;
Benchmarking::IDurationCollector& pDurationCollector;
IResultWriter& pResultWriter;
HydroManagement hydroManagement;
private:
/*
** \brief Log failed week
Expand Down Expand Up @@ -163,7 +169,7 @@ public:
// 4 - Hydraulic ventilation
{
Benchmarking::Timer timer;
simulation_->hydroManagement.makeVentilation(randomReservoirLevel,
hydroManagement.makeVentilation(randomReservoirLevel,
state[numSpace],
y,
numSpace);
Expand All @@ -189,7 +195,7 @@ public:
randomForCurrentYear,
failedWeekList,
isFirstPerformedYearOfSimulation,
simulation_->hydroManagement.ventilationResults(),
hydroManagement.ventilationResults(),
optWriter);

// Log failing weeks
Expand Down Expand Up @@ -243,11 +249,6 @@ inline ISimulation<Impl>::ISimulation(Data::Study& study,
pNbYearsReallyPerformed(0),
pNbMaxPerformedYearsInParallel(0),
pYearByYear(study.parameters.yearByYear),
hydroManagement(study.areas,
study.parameters,
study.calendar,
study.maxNbYearsInParallel,
resultWriter),
pFirstSetParallelWithAPerformedYearWasRun(false),
pDurationCollector(duration_collector),
pQueueService(study.pQueueService),
Expand Down

0 comments on commit 1b12eae

Please sign in to comment.