21 #ifndef __SOLVER_VARIABLE_ECONOMY_ProductionByRenewablePlant_H__
22 #define __SOLVER_VARIABLE_ECONOMY_ProductionByRenewablePlant_H__
24 #include "antares/solver/variable/variable.h"
26 namespace Antares::Solver::Variable::Economy
33 return "RES generation by plant";
45 return "Energy generated by all the RES clusters";
60 & (Category::FileLevel::de_res);
71 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
72 static constexpr uint8_t spatialAggregatePostProcessing = 0;
79 typedef std::vector<IntermediateValues> IntermediateValuesBaseType;
80 typedef std::vector<IntermediateValuesBaseType> IntermediateValuesType;
87 template<
class NextT = Container::EndOfList>
90 VCardProductionByRenewablePlant>
111 template<
int CDataLevel,
int CFile>
133 NextType::initializeFromStudy(study);
139 pNbYearsParallel = study->maxNbYearsInParallel;
140 pValuesForTheCurrentYear.resize(pNbYearsParallel);
143 pSize = area->renewable.list.enabledCount();
148 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
150 pValuesForTheCurrentYear[numSpace].resize(pSize);
153 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
155 for (
unsigned int i = 0; i != pSize; ++i)
157 pValuesForTheCurrentYear[numSpace][i].initializeFromStudy(*study);
161 for (
unsigned int i = 0; i != pSize; ++i)
172 NextType::initializeFromArea(study, area);
175 size_t getMaxNumberColumns()
const
183 NextType::initializeFromAreaLink(study, link);
186 void simulationBegin()
189 NextType::simulationBegin();
194 NextType::simulationEnd();
197 void yearBegin(
unsigned int year,
unsigned int numSpace)
200 for (
unsigned int i = 0; i != pSize; ++i)
202 pValuesForTheCurrentYear[numSpace][i].reset();
205 NextType::yearBegin(year, numSpace);
208 void yearEndBuildPrepareDataForEachThermalCluster(
State& state,
210 unsigned int numSpace)
213 NextType::yearEndBuildPrepareDataForEachThermalCluster(state, year, numSpace);
216 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
219 NextType::yearEndBuild(state, year, numSpace);
222 void yearEnd(
unsigned int year,
unsigned int numSpace)
226 for (
unsigned int i = 0; i < pSize; ++i)
229 pValuesForTheCurrentYear[numSpace][i].computeStatisticsForTheCurrentYear();
233 NextType::yearEnd(year, numSpace);
236 void computeSummary(
unsigned int year,
unsigned int numSpace)
238 for (
unsigned int i = 0; i < pSize; ++i)
245 NextType::computeSummary(year, numSpace);
248 void hourBegin(
unsigned int hourInTheYear)
251 NextType::hourBegin(hourInTheYear);
254 void hourForEachArea(
State& state,
unsigned int numSpace)
256 for (
const auto& renewableCluster: state.area->renewable.list.each_enabled())
258 double renewableClusterProduction = renewableCluster->valueAtTimeStep(
260 state.hourInTheYear);
262 pValuesForTheCurrentYear[numSpace][renewableCluster->enabledIndex]
263 .hour[state.hourInTheYear]
264 += renewableClusterProduction;
268 NextType::hourForEachArea(state, numSpace);
271 inline void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
274 NextType::buildDigest(
results, digestLevel, dataLevel);
277 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
279 unsigned int numSpace)
const
281 return pValuesForTheCurrentYear[numSpace][column].hour;
284 void localBuildAnnualSurveyReport(SurveyResults&
results,
287 unsigned int numSpace)
const
290 results.isCurrentVarNA = AncestorType::isNonApplicable;
292 if (AncestorType::isPrinted[0])
294 assert(NULL !=
results.data.area);
295 const auto& renewable =
results.data.area->renewable;
297 for (
auto& cluster: renewable.list.each_enabled())
300 results.variableCaption = cluster->name();
302 pValuesForTheCurrentYear[numSpace][cluster->enabledIndex]
303 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
310 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
312 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
Energy generated by all renewable clusters.
Definition: productionByRenewablePlant.h:91
VCardType::ResultsType ResultsType
List of expected results.
Definition: productionByRenewablePlant.h:101
@ count
How many items have we got.
Definition: productionByRenewablePlant.h:108
VCardProductionByRenewablePlant VCardType
VCard.
Definition: productionByRenewablePlant.h:96
NextT NextType
Type of the next static variable.
Definition: productionByRenewablePlant.h:94
Variable::IVariable< ProductionByRenewablePlant< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: productionByRenewablePlant.h:98
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: productionByRenewablePlant.h:113
Definition: productionByRenewablePlant.h:29
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: productionByRenewablePlant.h:57
static constexpr uint8_t precision
Precision (views)
Definition: productionByRenewablePlant.h:62
Results< R::AllYears::Average< > > ResultsType
The expecte results.
Definition: productionByRenewablePlant.h:51
VCardProductionByRenewablePlant VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: productionByRenewablePlant.h:54
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: productionByRenewablePlant.h:74
static std::string Unit()
Unit.
Definition: productionByRenewablePlant.h:37
static constexpr uint8_t decimal
Decimal precision.
Definition: productionByRenewablePlant.h:66
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: productionByRenewablePlant.h:64
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: productionByRenewablePlant.h:70
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: productionByRenewablePlant.h:76
static std::string Description()
The short description of the variable.
Definition: productionByRenewablePlant.h:43
static std::string Caption()
Caption.
Definition: productionByRenewablePlant.h:31
static constexpr int columnCount
Number of columns used by the variable.
Definition: productionByRenewablePlant.h:68
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: productionByRenewablePlant.h:59