23#include "antares/solver/variable/variable.h"
25namespace Antares::Solver::Variable::Economy
32 return "STS withdrawal by plant";
38 return "P-withdrawal - MW";
44 return "Energy withdrawn by ST storage clusters";
59 & (Category::FileLevel::de_sts);
70 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
71 static constexpr uint8_t spatialAggregatePostProcessing = 0;
78 typedef std::vector<IntermediateValues> IntermediateValuesBaseType;
79 typedef std::vector<IntermediateValuesBaseType> IntermediateValuesType;
86template<
class NextT = Container::EndOfList>
89 VCardSTstorageWithdrawalByCluster>
110 template<
int CDataLevel,
int CFile>
127 pNbYearsParallel = study->maxNbYearsInParallel;
128 pValuesForTheCurrentYear.resize(pNbYearsParallel);
131 nbClusters_ = area->shortTermStorage.count();
136 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
138 pValuesForTheCurrentYear[numSpace].resize(nbClusters_);
141 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
143 for (
unsigned int i = 0; i != nbClusters_; ++i)
145 pValuesForTheCurrentYear[numSpace][i].initializeFromStudy(*study);
149 for (
unsigned int i = 0; i != nbClusters_; ++i)
160 NextType::initializeFromArea(study, area);
163 size_t getMaxNumberColumns()
const
168 void yearBegin(
unsigned int year,
unsigned int numSpace)
171 for (
unsigned int i = 0; i != nbClusters_; ++i)
173 pValuesForTheCurrentYear[numSpace][i].reset();
176 NextType::yearBegin(year, numSpace);
179 void yearEnd(
unsigned int year,
unsigned int numSpace)
181 for (
unsigned int clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
185 pValuesForTheCurrentYear[numSpace][clusterIndex].computeStatisticsForTheCurrentYear();
188 NextType::yearEnd(year, numSpace);
191 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
192 unsigned int nbYearsForCurrentSummary)
194 for (
unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace)
196 for (
unsigned int clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
200 numSpaceToYear[numSpace],
201 pValuesForTheCurrentYear[numSpace][clusterIndex]);
206 NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary);
209 void hourBegin(
unsigned int hourInTheYear)
212 NextType::hourBegin(hourInTheYear);
215 void hourForEachArea(
State& state,
unsigned int numSpace)
217 for (uint clusterIndex = 0; clusterIndex != state.area->shortTermStorage.count();
221 pValuesForTheCurrentYear[numSpace][clusterIndex].hour[state.hourInTheYear]
222 = state.hourlyResults->ShortTermStorage[state.hourInTheWeek].withdrawal[clusterIndex];
226 NextType::hourForEachArea(state, numSpace);
229 inline void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
232 NextType::buildDigest(
results, digestLevel, dataLevel);
235 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
237 unsigned int numSpace)
const
239 return pValuesForTheCurrentYear[numSpace][column].hour;
242 void localBuildAnnualSurveyReport(SurveyResults&
results,
245 unsigned int numSpace)
const
248 results.isCurrentVarNA = AncestorType::isNonApplicable;
250 if (AncestorType::isPrinted[0])
252 assert(NULL !=
results.data.area);
253 const auto& shortTermStorage =
results.data.area->shortTermStorage;
256 uint clusterIndex = 0;
257 for (
const auto& cluster: shortTermStorage.storagesByIndex)
260 results.variableCaption = cluster.properties.name;
262 pValuesForTheCurrentYear[numSpace][clusterIndex]
263 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
272 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
274 unsigned int pNbYearsParallel;
Definition for a single area.
Definition area.h:52
Energy generated by short term storage clusters.
Definition STStorageWithdrawalByCluster.h:90
Variable::IVariable< STstorageWithdrawalByCluster< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition STStorageWithdrawalByCluster.h:97
@ count
How many items have we got.
Definition STStorageWithdrawalByCluster.h:107
VCardType::ResultsType ResultsType
List of expected results.
Definition STStorageWithdrawalByCluster.h:100
VCardSTstorageWithdrawalByCluster VCardType
VCard.
Definition STStorageWithdrawalByCluster.h:95
NextT NextType
Type of the next static variable.
Definition STStorageWithdrawalByCluster.h:93
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 STStorageWithdrawalByCluster.h:112
Definition STStorageWithdrawalByCluster.h:28
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition STStorageWithdrawalByCluster.h:58
Results< R::AllYears::Average< > > ResultsType
The expecte results.
Definition STStorageWithdrawalByCluster.h:50
VCardSTstorageWithdrawalByCluster VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition STStorageWithdrawalByCluster.h:53
static constexpr uint8_t precision
Precision (views)
Definition STStorageWithdrawalByCluster.h:61
static constexpr uint8_t decimal
Decimal precision.
Definition STStorageWithdrawalByCluster.h:65
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition STStorageWithdrawalByCluster.h:73
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition STStorageWithdrawalByCluster.h:63
static std::string Unit()
Unit.
Definition STStorageWithdrawalByCluster.h:36
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition STStorageWithdrawalByCluster.h:69
static constexpr uint8_t categoryDataLevel
Data Level.
Definition STStorageWithdrawalByCluster.h:56
static std::string Description()
The short description of the variable.
Definition STStorageWithdrawalByCluster.h:42
static std::string Caption()
Caption.
Definition STStorageWithdrawalByCluster.h:30
static constexpr int columnCount
Number of columns used by the variable.
Definition STStorageWithdrawalByCluster.h:67
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition STStorageWithdrawalByCluster.h:75