23 #include "antares/solver/variable/variable.h"
25 namespace Antares::Solver::Variable::Economy
32 return "UNSP. ENRG CSR";
44 return "Unsuplied Energy after CSR (demand that cannot be satisfied)";
57 static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
60 & (Category::FileLevel::id
61 | Category::FileLevel::va);
72 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
73 static constexpr uint8_t spatialAggregatePostProcessing = 0;
80 typedef std::vector<IntermediateValues> IntermediateValuesType;
82 using IntermediateValuesTypeForSpatialAg = std::unique_ptr<IntermediateValuesBaseType[]>;
86 template<
class NextT = Container::EndOfList>
109 template<
int CDataLevel,
int CFile>
114 count = ((VCardType::categoryDataLevel & CDataLevel
125 pNbYearsParallel = study.maxNbYearsInParallel;
130 pValuesForTheCurrentYear.resize(pNbYearsParallel);
131 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
133 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
137 NextType::initializeFromStudy(study);
143 VariableAccessorType::InitializeAndReset(
results, study);
149 NextType::initializeFromArea(study, area);
155 NextType::initializeFromAreaLink(study, link);
158 void simulationBegin()
160 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
162 pValuesForTheCurrentYear[numSpace].reset();
165 NextType::simulationBegin();
170 NextType::simulationEnd();
173 void yearBegin(
unsigned int year,
unsigned int numSpace)
176 pValuesForTheCurrentYear[numSpace].reset();
179 NextType::yearBegin(year, numSpace);
182 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
185 NextType::yearEndBuild(state, year, numSpace);
188 void yearEnd(
unsigned int year,
unsigned int numSpace)
191 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
194 NextType::yearEnd(year, numSpace);
197 void computeSummary(
unsigned int year,
unsigned int numSpace)
203 NextType::computeSummary(year, numSpace);
206 void hourBegin(
unsigned int hourInTheYear)
209 NextType::hourBegin(hourInTheYear);
212 void hourForEachArea(
State& state,
unsigned int numSpace)
214 pValuesForTheCurrentYear[numSpace][state.hourInTheYear]
215 = state.hourlyResults->ValeursHorairesDeDefaillancePositiveCSR[state.hourInTheWeek];
217 NextType::hourForEachArea(state, numSpace);
220 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
222 unsigned int numSpace)
const
224 return pValuesForTheCurrentYear[numSpace].hour;
227 void localBuildAnnualSurveyReport(SurveyResults&
results,
230 unsigned int numSpace)
const
233 results.isCurrentVarNA = AncestorType::isNonApplicable;
235 if (AncestorType::isPrinted[0])
240 pValuesForTheCurrentYear[numSpace]
241 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
247 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
248 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
Definition: unsupliedEnergyCsr.h:89
Variable::IVariable< UnsupliedEnergyCSR< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: unsupliedEnergyCsr.h:96
NextT NextType
Type of the next static variable.
Definition: unsupliedEnergyCsr.h:92
VCardType::ResultsType ResultsType
List of expected results.
Definition: unsupliedEnergyCsr.h:99
@ count
How many items have we got.
Definition: unsupliedEnergyCsr.h:106
VCardUnsupliedEnergyCSR VCardType
VCard.
Definition: unsupliedEnergyCsr.h:94
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: unsupliedEnergyCsr.h:111
Definition: unsupliedEnergyCsr.h:28
static constexpr uint8_t precision
Precision (views)
Definition: unsupliedEnergyCsr.h:63
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: unsupliedEnergyCsr.h:75
static constexpr uint8_t decimal
Decimal precision.
Definition: unsupliedEnergyCsr.h:67
VCardUnsupliedEnergyCSR VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: unsupliedEnergyCsr.h:56
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: unsupliedEnergyCsr.h:65
static std::string Description()
The short description of the variable.
Definition: unsupliedEnergyCsr.h:42
static std::string Unit()
Unit.
Definition: unsupliedEnergyCsr.h:36
static std::string Caption()
Caption.
Definition: unsupliedEnergyCsr.h:30
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: unsupliedEnergyCsr.h:53
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: unsupliedEnergyCsr.h:59
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: unsupliedEnergyCsr.h:77
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: unsupliedEnergyCsr.h:69
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: unsupliedEnergyCsr.h:71
Definition: stdDeviation.h:33