21 #ifndef __SOLVER_VARIABLE_ADEQUACY_SpilledEnergy_H__
22 #define __SOLVER_VARIABLE_ADEQUACY_SpilledEnergy_H__
24 #include "antares/solver/variable/variable.h"
26 namespace Antares::Solver::Variable::Adequacy
45 return "Spilled Energy (generation that cannot be satisfied)";
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[]>;
93 template<
class NextT = Container::EndOfList>
115 template<
int CDataLevel,
int CFile>
131 pNbYearsParallel = study.maxNbYearsInParallel;
136 pValuesForTheCurrentYear.resize(pNbYearsParallel);
137 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
139 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
143 NextType::initializeFromStudy(study);
149 VariableAccessorType::InitializeAndReset(
results, study);
155 NextType::initializeFromArea(study, area);
161 NextType::initializeFromAreaLink(study, link);
164 void simulationBegin()
166 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
168 pValuesForTheCurrentYear[numSpace].reset();
171 NextType::simulationBegin();
176 NextType::simulationEnd();
179 void yearBegin(
unsigned int year,
unsigned int numSpace)
182 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].computeStatisticsForTheCurrentYear();
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)
219 assert(state.hourlyResults &&
"Invalid pointer to simplex results");
222 pValuesForTheCurrentYear[numSpace][state.hourInTheYear]
223 = +state.hourlyResults->ValeursHorairesDeDefaillanceNegative[state.hourInTheWeek]
224 + state.resSpilled.entry[state.area->index][state.hourInTheWeek];
227 NextType::hourForEachArea(state, numSpace);
230 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
232 unsigned int numSpace)
const
234 return pValuesForTheCurrentYear[numSpace].hour;
237 void localBuildAnnualSurveyReport(SurveyResults&
results,
240 unsigned int numSpace)
const
243 results.isCurrentVarNA = AncestorType::isNonApplicable;
245 if (AncestorType::isPrinted[0])
250 pValuesForTheCurrentYear[numSpace]
251 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
257 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
258 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
C02 Average value of the overrall SpilledEnergy emissions expected from all the thermal dispatchable ...
Definition: spilledEnergy.h:95
Variable::IVariable< SpilledEnergy< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: spilledEnergy.h:102
NextT NextType
Type of the next static variable.
Definition: spilledEnergy.h:98
VCardType::ResultsType ResultsType
List of expected results.
Definition: spilledEnergy.h:105
VCardSpilledEnergy VCardType
VCard.
Definition: spilledEnergy.h:100
@ count
How many items have we got.
Definition: spilledEnergy.h:112
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: spilledEnergy.h:117
Definition: spilledEnergy.h:29
static constexpr uint8_t decimal
Decimal precision.
Definition: spilledEnergy.h:70
static std::string Caption()
Caption.
Definition: spilledEnergy.h:31
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: spilledEnergy.h:68
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: spilledEnergy.h:80
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: spilledEnergy.h:62
static std::string Description()
The short description of the variable.
Definition: spilledEnergy.h:43
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: spilledEnergy.h:74
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: spilledEnergy.h:72
VCardSpilledEnergy VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: spilledEnergy.h:57
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: spilledEnergy.h:60
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: spilledEnergy.h:78
static std::string Unit()
Unit.
Definition: spilledEnergy.h:37
static constexpr uint8_t precision
Precision (views)
Definition: spilledEnergy.h:66
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: spilledEnergy.h:54
Definition: stdDeviation.h:33