21#ifndef __SOLVER_VARIABLE_ECONOMY_AvailableDispatchGen_H__
22#define __SOLVER_VARIABLE_ECONOMY_AvailableDispatchGen_H__
24#include "antares/solver/variable/variable.h"
51 return "Available dispatchable generation";
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>
100 :
public Variable::IVariable<AvailableDispatchGen<NextT>, NextT, VCardAvailableDispatchGen>
121 template<
int CDataLevel,
int CFile>
137 pNbYearsParallel = study.maxNbYearsInParallel;
143 pValuesForTheCurrentYear.resize(pNbYearsParallel);
144 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
146 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
150 NextType::initializeFromStudy(study);
156 VariableAccessorType::InitializeAndReset(
results, study);
163 NextType::initializeFromArea(study, area);
169 NextType::initializeFromAreaLink(study, link);
172 void simulationBegin()
174 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
176 pValuesForTheCurrentYear[numSpace].reset();
180 NextType::simulationBegin();
185 NextType::simulationEnd();
188 void yearBegin(
unsigned int year,
unsigned int numSpace)
192 pValuesForTheCurrentYear[numSpace].reset();
193 for (
const auto& cluster: pArea->thermal.
list.each_enabled())
195 const auto& availableProduction = cluster->series.getColumn(year);
196 for (
unsigned int hour = 0; hour != cluster->series.timeSeries.height; ++hour)
198 pValuesForTheCurrentYear[numSpace].hour[hour] += availableProduction[hour];
203 NextType::yearBegin(year, numSpace);
206 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
209 NextType::yearEndBuild(state, year, numSpace);
212 void yearEnd(
unsigned int year,
unsigned int numSpace)
215 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
218 NextType::yearEnd(year, numSpace);
221 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
222 unsigned int nbYearsForCurrentSummary)
224 for (
unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace)
228 pValuesForTheCurrentYear[numSpace]);
232 NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary);
235 void hourBegin(
unsigned int hourInTheYear)
238 NextType::hourBegin(hourInTheYear);
241 void hourForEachArea(
State& state,
unsigned int numSpace)
244 NextType::hourForEachArea(state, numSpace);
247 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
249 unsigned int numSpace)
const
251 return pValuesForTheCurrentYear[numSpace].hour;
254 void localBuildAnnualSurveyReport(SurveyResults&
results,
257 unsigned int numSpace)
const
260 results.isCurrentVarNA = AncestorType::isNonApplicable;
262 if (AncestorType::isPrinted[0])
267 pValuesForTheCurrentYear[numSpace]
268 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
274 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
277 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition links.h:50
Definition for a single area.
Definition area.h:52
ThermalClusterList list
List of all thermal clusters (enabled and disabled) except must-run clusters.
Definition container.h:90
Marginal AvailableDispatchGen.
Definition avail-dispatchable-generation.h:101
VCardAvailableDispatchGen VCardType
VCard.
Definition avail-dispatchable-generation.h:106
@ count
How many items have we got.
Definition avail-dispatchable-generation.h:118
NextT NextType
Type of the next static variable.
Definition avail-dispatchable-generation.h:104
VCardType::ResultsType ResultsType
List of expected results.
Definition avail-dispatchable-generation.h:111
Variable::IVariable< AvailableDispatchGen< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition avail-dispatchable-generation.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 avail-dispatchable-generation.h:123
Definition avail-dispatchable-generation.h:35
static constexpr uint8_t categoryDataLevel
Data Level.
Definition avail-dispatchable-generation.h:66
static std::string Caption()
Caption.
Definition avail-dispatchable-generation.h:37
static constexpr uint8_t precision
Precision (views)
Definition avail-dispatchable-generation.h:72
static constexpr uint8_t decimal
Decimal precision.
Definition avail-dispatchable-generation.h:76
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition avail-dispatchable-generation.h:78
VCardAvailableDispatchGen VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition avail-dispatchable-generation.h:63
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition avail-dispatchable-generation.h:84
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition avail-dispatchable-generation.h:80
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition avail-dispatchable-generation.h:68
static std::string Description()
The short description of the variable.
Definition avail-dispatchable-generation.h:49
static std::string Unit()
Unit.
Definition avail-dispatchable-generation.h:43
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition avail-dispatchable-generation.h:60
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition avail-dispatchable-generation.h:86
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition avail-dispatchable-generation.h:74
Definition stdDeviation.h:40