21 #ifndef __SOLVER_VARIABLE_ECONOMY_ReservoirLevel_H__
22 #define __SOLVER_VARIABLE_ECONOMY_ReservoirLevel_H__
24 #include "antares/solver/variable/variable.h"
26 namespace Antares::Solver::Variable::Economy
63 & (Category::FileLevel::id
64 | Category::FileLevel::va);
75 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
76 static constexpr uint8_t spatialAggregatePostProcessing = 0;
83 typedef std::vector<IntermediateValues> IntermediateValuesType;
85 using IntermediateValuesTypeForSpatialAg = std::unique_ptr<IntermediateValuesBaseType[]>;
92 template<
class NextT = Container::EndOfList>
114 template<
int CDataLevel,
int CFile>
130 pNbYearsParallel = study.maxNbYearsInParallel;
134 pValuesForTheCurrentYear.resize(pNbYearsParallel);
135 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
137 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
141 NextType::initializeFromStudy(study);
147 VariableAccessorType::InitializeAndReset(
results, study);
153 pReservoirCapacity = area->hydro.reservoirCapacity;
154 NextType::initializeFromArea(study, area);
160 NextType::initializeFromAreaLink(study, link);
163 void simulationBegin()
165 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
167 pValuesForTheCurrentYear[numSpace].reset();
170 NextType::simulationBegin();
175 NextType::simulationEnd();
178 void yearBegin(
unsigned int year,
unsigned int numSpace)
181 pValuesForTheCurrentYear[numSpace].reset();
184 NextType::yearBegin(year, numSpace);
187 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
190 NextType::yearEndBuild(state, year, numSpace);
193 void yearEnd(
unsigned int year,
unsigned int numSpace)
196 pValuesForTheCurrentYear[numSpace].computeAveragesForCurrentYearFromHourlyResults();
199 NextType::yearEnd(year, numSpace);
202 void computeSummary(
unsigned int year,
unsigned int numSpace)
208 NextType::computeSummary(year, numSpace);
211 void hourBegin(
unsigned int hourInTheYear)
214 NextType::hourBegin(hourInTheYear);
217 void hourForEachArea(
State& state,
unsigned int numSpace)
220 pValuesForTheCurrentYear[numSpace].hour[state.hourInTheYear] = state.hourlyResults
222 [state.hourInTheWeek]
223 / pReservoirCapacity * 100.;
226 NextType::hourForEachArea(state, numSpace);
229 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
231 unsigned int numSpace)
const
233 return pValuesForTheCurrentYear[numSpace].hour;
236 void localBuildAnnualSurveyReport(SurveyResults&
results,
239 unsigned int numSpace)
const
242 results.isCurrentVarNA = AncestorType::isNonApplicable;
244 if (AncestorType::isPrinted[0])
249 pValuesForTheCurrentYear[numSpace]
250 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
256 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
257 unsigned int pNbYearsParallel;
258 double pReservoirCapacity;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
Reservoir level.
Definition: reservoirlevel.h:94
VCardType::ResultsType ResultsType
List of expected results.
Definition: reservoirlevel.h:104
@ count
How many items have we got.
Definition: reservoirlevel.h:111
NextT NextType
Type of the next static variable.
Definition: reservoirlevel.h:97
Variable::IVariable< ReservoirLevel< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: reservoirlevel.h:101
VCardReservoirLevel VCardType
VCard.
Definition: reservoirlevel.h:99
Interface for any variable.
Definition: variable.h:47
const StoredResultType & results() const
The results.
Definition: variable.hxx:544
StoredResultType pResults
All the results about this variable.
Definition: variable.h:323
@ count
The count if item in the list.
Definition: results.h:52
Definition: cbuilder.h:120
Definition: reservoirlevel.h:116
Definition: reservoirlevel.h:29
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: reservoirlevel.h:54
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: reservoirlevel.h:72
static std::string Unit()
Unit.
Definition: reservoirlevel.h:37
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: reservoirlevel.h:68
static constexpr uint8_t precision
Precision (views)
Definition: reservoirlevel.h:66
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: reservoirlevel.h:62
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: reservoirlevel.h:60
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: reservoirlevel.h:78
static std::string Caption()
Caption.
Definition: reservoirlevel.h:31
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable.
Definition: reservoirlevel.h:80
VCardReservoirLevel VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: reservoirlevel.h:57
static constexpr uint8_t decimal
Decimal precision.
Definition: reservoirlevel.h:70
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: reservoirlevel.h:74
static std::string Description()
The short description of the variable.
Definition: reservoirlevel.h:43
Definition: stdDeviation.h:33