21#ifndef __SOLVER_VARIABLE_ADEQUACY_SpilledEnergy_H__
22#define __SOLVER_VARIABLE_ADEQUACY_SpilledEnergy_H__
24#include "antares/solver/variable/variable.h"
51 return "Spilled Energy (generation that cannot be satisfied)";
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;
99template<
class NextT = Container::EndOfList>
121 template<
int CDataLevel,
int CFile>
137 pNbYearsParallel = study.maxNbYearsInParallel;
142 pValuesForTheCurrentYear.resize(pNbYearsParallel);
143 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
145 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
149 NextType::initializeFromStudy(study);
155 VariableAccessorType::InitializeAndReset(
results, study);
161 NextType::initializeFromArea(study, area);
167 NextType::initializeFromAreaLink(study, link);
170 void simulationBegin()
172 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
174 pValuesForTheCurrentYear[numSpace].reset();
177 NextType::simulationBegin();
182 NextType::simulationEnd();
185 void yearBegin(
unsigned int year,
unsigned int numSpace)
188 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].computeStatisticsForTheCurrentYear();
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)
230 assert(state.hourlyResults &&
"Invalid pointer to simplex results");
233 pValuesForTheCurrentYear[numSpace][state.hourInTheYear]
234 = +state.hourlyResults->ValeursHorairesDeDefaillanceNegative[state.hourInTheWeek]
235 + state.resSpilled.entry[state.area->index][state.hourInTheWeek];
238 NextType::hourForEachArea(state, numSpace);
241 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
243 unsigned int numSpace)
const
245 return pValuesForTheCurrentYear[numSpace].hour;
248 void localBuildAnnualSurveyReport(SurveyResults&
results,
251 unsigned int numSpace)
const
254 results.isCurrentVarNA = AncestorType::isNonApplicable;
256 if (AncestorType::isPrinted[0])
261 pValuesForTheCurrentYear[numSpace]
262 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
268 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
269 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition links.h:50
Definition for a single area.
Definition area.h:52
C02 Average value of the overrall SpilledEnergy emissions expected from all the thermal dispatchable ...
Definition spilledEnergy.h:101
@ count
How many items have we got.
Definition spilledEnergy.h:118
NextT NextType
Type of the next static variable.
Definition spilledEnergy.h:104
VCardType::ResultsType ResultsType
List of expected results.
Definition spilledEnergy.h:111
VCardSpilledEnergy VCardType
VCard.
Definition spilledEnergy.h:106
Variable::IVariable< SpilledEnergy< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition spilledEnergy.h:108
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 spilledEnergy.h:123
Definition spilledEnergy.h:35
static constexpr uint8_t decimal
Decimal precision.
Definition spilledEnergy.h:76
static std::string Caption()
Caption.
Definition spilledEnergy.h:37
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition spilledEnergy.h:74
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition spilledEnergy.h:86
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition spilledEnergy.h:68
static std::string Description()
The short description of the variable.
Definition spilledEnergy.h:49
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition spilledEnergy.h:80
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition spilledEnergy.h:78
static constexpr uint8_t categoryDataLevel
Data Level.
Definition spilledEnergy.h:66
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition spilledEnergy.h:84
static std::string Unit()
Unit.
Definition spilledEnergy.h:43
static constexpr uint8_t precision
Precision (views)
Definition spilledEnergy.h:72
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition spilledEnergy.h:60
VCardSpilledEnergy VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition spilledEnergy.h:63
Definition stdDeviation.h:40