21 #ifndef __SOLVER_VARIABLE_ECONOMY_PSP_H__
22 #define __SOLVER_VARIABLE_ECONOMY_PSP_H__
24 #include <antares/study/area/constants.h>
25 #include "antares/solver/variable/variable.h"
27 namespace Antares::Solver::Variable::Economy
61 & (Category::FileLevel::id
62 | Category::FileLevel::va);
73 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
74 static constexpr uint8_t spatialAggregatePostProcessing = 0;
81 typedef std::vector<IntermediateValues> IntermediateValuesType;
82 using IntermediateValuesTypeForSpatialAg = std::unique_ptr<IntermediateValuesBaseType[]>;
89 template<
class NextT = Container::EndOfList>
111 template<
int CDataLevel,
int CFile>
127 pNbYearsParallel = study.maxNbYearsInParallel;
133 pValuesForTheCurrentYear.resize(pNbYearsParallel);
134 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
136 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
140 NextType::initializeFromStudy(study);
146 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
148 (void)::memcpy(pValuesForTheCurrentYear[numSpace].hour,
149 area->miscGen.entry[Data::fhhPSP],
150 sizeof(
double) * area->miscGen.height);
154 NextType::initializeFromArea(study, area);
160 NextType::initializeFromAreaLink(study, link);
166 VariableAccessorType::InitializeAndReset(
results, study);
169 void simulationBegin()
172 NextType::simulationBegin();
177 NextType::simulationEnd();
180 void yearBegin(
unsigned int year,
unsigned int numSpace)
183 NextType::yearBegin(year, numSpace);
186 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
189 NextType::yearEndBuild(state, year, numSpace);
192 void yearEnd(
unsigned int year,
unsigned int numSpace)
195 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
198 NextType::yearEnd(year, numSpace);
201 void computeSummary(
unsigned int year,
unsigned int numSpace)
207 NextType::computeSummary(year, numSpace);
210 void hourBegin(
unsigned int hourInTheYear)
213 NextType::hourBegin(hourInTheYear);
216 void hourForEachArea(
State& state,
unsigned int numSpace)
219 NextType::hourForEachArea(state, numSpace);
222 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
224 unsigned int numSpace)
const
226 return pValuesForTheCurrentYear[numSpace].hour;
229 void localBuildAnnualSurveyReport(SurveyResults&
results,
232 unsigned int numSpace)
const
235 results.isCurrentVarNA = AncestorType::isNonApplicable;
237 if (AncestorType::isPrinted[0])
242 pValuesForTheCurrentYear[numSpace]
243 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
249 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
250 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
Marginal PSP.
Definition: psp.h:91
NextT NextType
Type of the next static variable.
Definition: psp.h:94
VCardType::ResultsType ResultsType
List of expected results.
Definition: psp.h:101
Variable::IVariable< PSP< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: psp.h:98
@ count
How many items have we got.
Definition: psp.h:108
VCardPSP VCardType
VCard.
Definition: psp.h:96
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
static std::string Unit()
Unit.
Definition: psp.h:38
Results< R::AllYears::Average< > > ResultsType
The expecte results.
Definition: psp.h:52
static std::string Description()
The short description of the variable.
Definition: psp.h:44
static constexpr uint8_t precision
Precision (views)
Definition: psp.h:64
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: psp.h:78
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: psp.h:60
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: psp.h:72
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: psp.h:76
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: psp.h:66
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: psp.h:70
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: psp.h:58
VCardPSP VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: psp.h:55
static constexpr uint8_t decimal
Decimal precision.
Definition: psp.h:68
static std::string Caption()
Caption.
Definition: psp.h:32