21#ifndef __SOLVER_VARIABLE_ECONOMY_ReservoirLevel_H__
22#define __SOLVER_VARIABLE_ECONOMY_ReservoirLevel_H__
24#include "antares/solver/variable/variable.h"
69 & (Category::FileLevel::id
70 | Category::FileLevel::va);
81 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
82 static constexpr uint8_t spatialAggregatePostProcessing = 0;
89 typedef std::vector<IntermediateValues> IntermediateValuesType;
98template<
class NextT = Container::EndOfList>
120 template<
int CDataLevel,
int CFile>
136 pNbYearsParallel = study.maxNbYearsInParallel;
140 pValuesForTheCurrentYear.resize(pNbYearsParallel);
141 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
143 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
147 NextType::initializeFromStudy(study);
153 VariableAccessorType::InitializeAndReset(
results, study);
159 pReservoirCapacity = area->hydro.reservoirCapacity;
160 NextType::initializeFromArea(study, area);
166 NextType::initializeFromAreaLink(study, link);
169 void simulationBegin()
171 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
173 pValuesForTheCurrentYear[numSpace].reset();
176 NextType::simulationBegin();
181 NextType::simulationEnd();
184 void yearBegin(
unsigned int year,
unsigned int numSpace)
187 pValuesForTheCurrentYear[numSpace].reset();
190 NextType::yearBegin(year, numSpace);
193 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
196 NextType::yearEndBuild(state, year, numSpace);
199 void yearEnd(
unsigned int year,
unsigned int numSpace)
202 pValuesForTheCurrentYear[numSpace].computeAveragesForCurrentYearFromHourlyResults();
205 NextType::yearEnd(year, numSpace);
208 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
209 unsigned int nbYearsForCurrentSummary)
211 for (
unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace)
215 pValuesForTheCurrentYear[numSpace]);
219 NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary);
222 void hourBegin(
unsigned int hourInTheYear)
225 NextType::hourBegin(hourInTheYear);
228 void hourForEachArea(
State& state,
unsigned int numSpace)
231 pValuesForTheCurrentYear[numSpace].hour[state.hourInTheYear] = state.hourlyResults
233 [state.hourInTheWeek]
234 / pReservoirCapacity * 100.;
237 NextType::hourForEachArea(state, numSpace);
240 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
242 unsigned int numSpace)
const
244 return pValuesForTheCurrentYear[numSpace].hour;
247 void localBuildAnnualSurveyReport(SurveyResults&
results,
250 unsigned int numSpace)
const
253 results.isCurrentVarNA = AncestorType::isNonApplicable;
255 if (AncestorType::isPrinted[0])
260 pValuesForTheCurrentYear[numSpace]
261 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
267 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
268 unsigned int pNbYearsParallel;
269 double pReservoirCapacity;
Definition of a link between two areas (Interconnection)
Definition links.h:50
Definition for a single area.
Definition area.h:52
Reservoir level.
Definition reservoirlevel.h:100
@ count
How many items have we got.
Definition reservoirlevel.h:117
NextT NextType
Type of the next static variable.
Definition reservoirlevel.h:103
Variable::IVariable< ReservoirLevel< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition reservoirlevel.h:107
VCardType::ResultsType ResultsType
List of expected results.
Definition reservoirlevel.h:110
VCardReservoirLevel VCardType
VCard.
Definition reservoirlevel.h:105
Interface for any variable.
Definition variable.h:51
const StoredResultType & results() const
Definition variable.hxx:544
StoredResultType pResults
All the results about this variable.
Definition variable.h:327
@ count
The count if item in the list.
Definition results.h:56
Definition cbuilder.h:120
Definition reservoirlevel.h:122
Definition reservoirlevel.h:35
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition reservoirlevel.h:78
static std::string Unit()
Unit.
Definition reservoirlevel.h:43
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition reservoirlevel.h:74
static constexpr uint8_t precision
Precision (views)
Definition reservoirlevel.h:72
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition reservoirlevel.h:68
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition reservoirlevel.h:60
static constexpr uint8_t categoryDataLevel
Data Level.
Definition reservoirlevel.h:66
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition reservoirlevel.h:84
VCardReservoirLevel VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition reservoirlevel.h:63
static std::string Caption()
Caption.
Definition reservoirlevel.h:37
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable.
Definition reservoirlevel.h:86
static constexpr uint8_t decimal
Decimal precision.
Definition reservoirlevel.h:76
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition reservoirlevel.h:80
static std::string Description()
The short description of the variable.
Definition reservoirlevel.h:49
Definition stdDeviation.h:40