23 #include "antares/solver/variable/variable.h"
25 namespace Antares::Solver::Variable::Economy
32 return "STS lvl by plant";
38 return "Levels - MWh";
44 return "Levels 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 VCardSTstorageLevelsByCluster>
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]
186 .computeAveragesForCurrentYearFromHourlyResults();
189 NextType::yearEnd(year, numSpace);
192 void computeSummary(
unsigned int year,
unsigned int numSpace)
194 for (
unsigned int clusterIndex = 0; clusterIndex < nbClusters_; ++clusterIndex)
198 .merge(year, pValuesForTheCurrentYear[numSpace][clusterIndex]);
202 NextType::computeSummary(year, numSpace);
205 void hourBegin(
unsigned int hourInTheYear)
208 NextType::hourBegin(hourInTheYear);
211 void hourForEachArea(
State& state,
unsigned int numSpace)
213 for (uint clusterIndex = 0; clusterIndex != state.area->shortTermStorage.count();
217 pValuesForTheCurrentYear[numSpace][clusterIndex].hour[state.hourInTheYear]
218 = state.hourlyResults->ShortTermStorage[clusterIndex].level[state.hourInTheWeek];
222 NextType::hourForEachArea(state, numSpace);
225 inline void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
228 NextType::buildDigest(
results, digestLevel, dataLevel);
231 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
233 unsigned int numSpace)
const
235 return pValuesForTheCurrentYear[numSpace][column].hour;
238 void localBuildAnnualSurveyReport(SurveyResults&
results,
241 unsigned int numSpace)
const
244 results.isCurrentVarNA = AncestorType::isNonApplicable;
246 if (AncestorType::isPrinted[0])
248 assert(NULL !=
results.data.area);
249 const auto& shortTermStorage =
results.data.area->shortTermStorage;
252 uint clusterIndex = 0;
253 for (
const auto& sts: shortTermStorage.storagesByIndex)
256 results.variableCaption = sts.properties.name;
258 pValuesForTheCurrentYear[numSpace][clusterIndex]
259 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
268 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
270 unsigned int pNbYearsParallel;
Definition for a single area.
Definition: area.h:51
Energy generated by short term storage clusters.
Definition: STStorageLevelsByCluster.h:90
NextT NextType
Type of the next static variable.
Definition: STStorageLevelsByCluster.h:93
Variable::IVariable< STstorageLevelsByCluster< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: STStorageLevelsByCluster.h:97
VCardType::ResultsType ResultsType
List of expected results.
Definition: STStorageLevelsByCluster.h:100
VCardSTstorageLevelsByCluster VCardType
VCard.
Definition: STStorageLevelsByCluster.h:95
@ count
How many items have we got.
Definition: STStorageLevelsByCluster.h:107
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: STStorageLevelsByCluster.h:112
Definition: STStorageLevelsByCluster.h:28
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: STStorageLevelsByCluster.h:73
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: STStorageLevelsByCluster.h:75
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: STStorageLevelsByCluster.h:63
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: STStorageLevelsByCluster.h:58
Results< R::AllYears::Average< > > ResultsType
The expecte results.
Definition: STStorageLevelsByCluster.h:50
static constexpr uint8_t decimal
Decimal precision.
Definition: STStorageLevelsByCluster.h:65
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: STStorageLevelsByCluster.h:69
static constexpr int columnCount
Number of columns used by the variable.
Definition: STStorageLevelsByCluster.h:67
VCardSTstorageLevelsByCluster VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: STStorageLevelsByCluster.h:53
static std::string Caption()
Caption.
Definition: STStorageLevelsByCluster.h:30
static std::string Unit()
Unit.
Definition: STStorageLevelsByCluster.h:36
static std::string Description()
The short description of the variable.
Definition: STStorageLevelsByCluster.h:42
static constexpr uint8_t precision
Precision (views)
Definition: STStorageLevelsByCluster.h:61
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: STStorageLevelsByCluster.h:56