21#ifndef __SOLVER_VARIABLE_ECONOMY_DispatchableGeneration_H__
22#define __SOLVER_VARIABLE_ECONOMY_DispatchableGeneration_H__
24#include "antares/solver/variable/variable.h"
39 return "Dispatch. Gen.";
51 return "Value of all the dispatchable generation throughout all MC years";
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 IntermediateValuesBaseType* IntermediateValuesType;
91 typedef IntermediateValuesBaseType* IntermediateValuesTypeForSpatialAg;
95 static std::string
Caption(
const unsigned int indx)
114 return "MISC. DTG 2";
116 return "MISC. DTG 3";
118 return "MISC. DTG 4";
125 static std::string
Unit([[maybe_unused]]
const unsigned int indx)
135template<
class NextT = Container::EndOfList>
137 :
public Variable::IVariable<DispatchableGeneration<NextT>, NextT, VCardDispatchableGeneration>
158 template<
int CDataLevel,
int CFile>
174 delete[] pValuesForTheCurrentYear;
179 pNbYearsParallel = study.maxNbYearsInParallel;
183 pValuesForTheCurrentYear =
new VCardType::IntermediateValuesBaseType[pNbYearsParallel];
184 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; ++numSpace)
188 pValuesForTheCurrentYear[numSpace][i].initializeFromStudy(study);
193 NextType::initializeFromStudy(study);
201 results[i].initializeFromStudy(study);
209 NextType::initializeFromArea(study, area);
215 NextType::initializeFromAreaLink(study, link);
218 void simulationBegin()
221 NextType::simulationBegin();
226 NextType::simulationEnd();
229 void yearBegin(
unsigned int year,
unsigned int numSpace)
234 pValuesForTheCurrentYear[numSpace][i].reset();
237 NextType::yearBegin(year, numSpace);
240 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
243 NextType::yearEndBuild(state, year, numSpace);
246 void yearEnd(
unsigned int year,
unsigned int numSpace)
248 VariableAccessorType::template ComputeStatistics<VCardType>(
249 pValuesForTheCurrentYear[numSpace]);
252 NextType::yearEnd(year, numSpace);
255 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
256 unsigned int nbYearsForCurrentSummary)
258 for (
unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace)
260 VariableAccessorType::ComputeSummary(pValuesForTheCurrentYear[numSpace],
262 numSpaceToYear[numSpace]);
265 NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary);
268 void hourBegin(
unsigned int hourInTheYear)
271 NextType::hourBegin(hourInTheYear);
274 void hourForEachArea(
State& state,
unsigned int numSpace)
276 auto area = state.area;
277 auto& thermal = state.thermal;
278 for (
auto& cluster: area->thermal.list.each_enabled())
280 pValuesForTheCurrentYear[numSpace][cluster->groupID][state.hourInTheYear]
281 += thermal[area->index].thermalClustersProductions[cluster->enabledIndex];
285 NextType::hourForEachArea(state, numSpace);
288 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
290 unsigned int numSpace)
const
292 return pValuesForTheCurrentYear[numSpace][column].hour;
295 void localBuildAnnualSurveyReport(SurveyResults&
results,
298 unsigned int numSpace)
const
301 results.isCurrentVarNA = AncestorType::isNonApplicable;
305 if (AncestorType::isPrinted[i])
310 pValuesForTheCurrentYear[numSpace][i]
311 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
319 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
320 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition links.h:50
Definition for a single area.
Definition area.h:52
Marginal DispatchableGeneration.
Definition dispatchableGeneration.h:138
@ count
How many items have we got.
Definition dispatchableGeneration.h:155
VCardType::ResultsType ResultsType
List of expected results.
Definition dispatchableGeneration.h:148
Variable::IVariable< DispatchableGeneration< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition dispatchableGeneration.h:145
VCardDispatchableGeneration VCardType
VCard.
Definition dispatchableGeneration.h:143
NextT NextType
Type of the next static variable.
Definition dispatchableGeneration.h:141
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 dispatchableGeneration.h:160
Definition dispatchableGeneration.h:94
Definition dispatchableGeneration.h:35
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition dispatchableGeneration.h:84
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition dispatchableGeneration.h:68
VCardDispatchableGeneration VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition dispatchableGeneration.h:63
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition dispatchableGeneration.h:86
static constexpr uint8_t precision
Precision (views)
Definition dispatchableGeneration.h:72
static constexpr uint8_t categoryDataLevel
Data Level.
Definition dispatchableGeneration.h:66
static std::string Description()
The short description of the variable.
Definition dispatchableGeneration.h:49
static std::string Unit()
Unit.
Definition dispatchableGeneration.h:43
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition dispatchableGeneration.h:60
static constexpr uint8_t decimal
Decimal precision.
Definition dispatchableGeneration.h:76
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition dispatchableGeneration.h:80
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition dispatchableGeneration.h:78
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition dispatchableGeneration.h:74
static std::string Caption()
Caption.
Definition dispatchableGeneration.h:37
Definition stdDeviation.h:40