21 #ifndef __SOLVER_VARIABLE_ECONOMY_AvailableDispatchGen_H__
22 #define __SOLVER_VARIABLE_ECONOMY_AvailableDispatchGen_H__
24 #include "antares/solver/variable/variable.h"
26 namespace Antares::Solver::Variable::Economy
45 return "Available dispatchable generation";
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[]>;
92 template<
class NextT = Container::EndOfList>
115 template<
int CDataLevel,
int CFile>
131 pNbYearsParallel = study.maxNbYearsInParallel;
137 pValuesForTheCurrentYear.resize(pNbYearsParallel);
138 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
140 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
144 NextType::initializeFromStudy(study);
150 VariableAccessorType::InitializeAndReset(
results, study);
157 NextType::initializeFromArea(study, area);
163 NextType::initializeFromAreaLink(study, link);
166 void simulationBegin()
168 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
170 pValuesForTheCurrentYear[numSpace].reset();
174 NextType::simulationBegin();
179 NextType::simulationEnd();
182 void yearBegin(
unsigned int year,
unsigned int numSpace)
186 pValuesForTheCurrentYear[numSpace].reset();
187 for (
const auto& cluster: pArea->thermal.
list.each_enabled())
189 const auto& availableProduction = cluster->series.getColumn(year);
190 for (
unsigned int hour = 0; hour != cluster->series.timeSeries.height; ++hour)
192 pValuesForTheCurrentYear[numSpace].hour[hour] += availableProduction[hour];
197 NextType::yearBegin(year, numSpace);
200 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
203 NextType::yearEndBuild(state, year, numSpace);
206 void yearEnd(
unsigned int year,
unsigned int numSpace)
209 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
212 NextType::yearEnd(year, numSpace);
215 void computeSummary(
unsigned int year,
unsigned int numSpace)
221 NextType::computeSummary(year, numSpace);
224 void hourBegin(
unsigned int hourInTheYear)
227 NextType::hourBegin(hourInTheYear);
230 void hourForEachArea(
State& state,
unsigned int numSpace)
233 NextType::hourForEachArea(state, numSpace);
236 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
238 unsigned int numSpace)
const
240 return pValuesForTheCurrentYear[numSpace].hour;
243 void localBuildAnnualSurveyReport(SurveyResults&
results,
246 unsigned int numSpace)
const
249 results.isCurrentVarNA = AncestorType::isNonApplicable;
251 if (AncestorType::isPrinted[0])
256 pValuesForTheCurrentYear[numSpace]
257 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
263 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
266 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
ThermalClusterList list
List of all thermal clusters (enabled and disabled) except must-run clusters.
Definition: container.h:88
Marginal AvailableDispatchGen.
Definition: avail-dispatchable-generation.h:95
VCardType::ResultsType ResultsType
List of expected results.
Definition: avail-dispatchable-generation.h:105
NextT NextType
Type of the next static variable.
Definition: avail-dispatchable-generation.h:98
Variable::IVariable< AvailableDispatchGen< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: avail-dispatchable-generation.h:102
VCardAvailableDispatchGen VCardType
VCard.
Definition: avail-dispatchable-generation.h:100
@ count
How many items have we got.
Definition: avail-dispatchable-generation.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: avail-dispatchable-generation.h:117
Definition: avail-dispatchable-generation.h:29
VCardAvailableDispatchGen VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: avail-dispatchable-generation.h:57
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: avail-dispatchable-generation.h:54
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: avail-dispatchable-generation.h:60
static std::string Caption()
Caption.
Definition: avail-dispatchable-generation.h:31
static constexpr uint8_t precision
Precision (views)
Definition: avail-dispatchable-generation.h:66
static constexpr uint8_t decimal
Decimal precision.
Definition: avail-dispatchable-generation.h:70
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: avail-dispatchable-generation.h:72
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: avail-dispatchable-generation.h:78
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: avail-dispatchable-generation.h:74
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: avail-dispatchable-generation.h:62
static std::string Description()
The short description of the variable.
Definition: avail-dispatchable-generation.h:43
static std::string Unit()
Unit.
Definition: avail-dispatchable-generation.h:37
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: avail-dispatchable-generation.h:80
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: avail-dispatchable-generation.h:68
Definition: stdDeviation.h:33