23 #include "antares/solver/variable/variable.h"
25 namespace 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;
86 template<
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(
unsigned int year,
unsigned int numSpace)
193 for (
unsigned int clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
197 .merge(year, pValuesForTheCurrentYear[numSpace][clusterIndex]);
201 NextType::computeSummary(year, numSpace);
204 void hourBegin(
unsigned int hourInTheYear)
207 NextType::hourBegin(hourInTheYear);
210 void hourForEachArea(
State& state,
unsigned int numSpace)
212 for (uint clusterIndex = 0; clusterIndex != state.area->shortTermStorage.count();
216 pValuesForTheCurrentYear[numSpace][clusterIndex].hour[state.hourInTheYear]
217 = state.hourlyResults->ShortTermStorage[clusterIndex].withdrawal[state.hourInTheWeek];
221 NextType::hourForEachArea(state, numSpace);
224 inline void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
227 NextType::buildDigest(
results, digestLevel, dataLevel);
230 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
232 unsigned int numSpace)
const
234 return pValuesForTheCurrentYear[numSpace][column].hour;
237 void localBuildAnnualSurveyReport(SurveyResults&
results,
240 unsigned int numSpace)
const
243 results.isCurrentVarNA = AncestorType::isNonApplicable;
245 if (AncestorType::isPrinted[0])
247 assert(NULL !=
results.data.area);
248 const auto& shortTermStorage =
results.data.area->shortTermStorage;
251 uint clusterIndex = 0;
252 for (
const auto& sts: shortTermStorage.storagesByIndex)
255 results.variableCaption = sts.properties.name;
257 pValuesForTheCurrentYear[numSpace][clusterIndex]
258 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
267 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
269 unsigned int pNbYearsParallel;
Definition for a single area.
Definition: area.h:51
Energy generated by short term storage clusters.
Definition: STStorageWithdrawalByCluster.h:90
@ count
How many items have we got.
Definition: STStorageWithdrawalByCluster.h:107
VCardSTstorageWithdrawalByCluster VCardType
VCard.
Definition: STStorageWithdrawalByCluster.h:95
NextT NextType
Type of the next static variable.
Definition: STStorageWithdrawalByCluster.h:93
VCardType::ResultsType ResultsType
List of expected results.
Definition: STStorageWithdrawalByCluster.h:100
Variable::IVariable< STstorageWithdrawalByCluster< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: STStorageWithdrawalByCluster.h:97
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: 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
static constexpr uint8_t precision
Precision (views)
Definition: STStorageWithdrawalByCluster.h:61
static constexpr uint8_t decimal
Decimal precision.
Definition: STStorageWithdrawalByCluster.h:65
Results< R::AllYears::Average< > > ResultsType
The expecte results.
Definition: STStorageWithdrawalByCluster.h:50
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: STStorageWithdrawalByCluster.h:73
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: STStorageWithdrawalByCluster.h:63
VCardSTstorageWithdrawalByCluster VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: STStorageWithdrawalByCluster.h:53
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