21 #ifndef __SOLVER_VARIABLE_ECONOMY_Price_H__
22 #define __SOLVER_VARIABLE_ECONOMY_Price_H__
24 #include "antares/solver/variable/variable.h"
26 namespace Antares::Solver::Variable::Economy
45 return "Marginal Price, throughout all MC years";
63 & (Category::FileLevel::id
64 | Category::FileLevel::va);
75 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
76 static constexpr uint8_t spatialAggregatePostProcessing = Category::
77 spatialAggregatePostProcessingPrice;
84 typedef std::vector<IntermediateValues> IntermediateValuesType;
86 using IntermediateValuesTypeForSpatialAg = std::unique_ptr<IntermediateValuesBaseType[]>;
93 template<
class NextT = Container::EndOfList>
115 template<
int CDataLevel,
int CFile>
131 pNbYearsParallel = study.maxNbYearsInParallel;
137 pValuesForTheCurrentYear.resize(pNbYearsParallel);
138 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
140 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
144 NextType::initializeFromStudy(study);
150 VariableAccessorType::InitializeAndReset(
results, study);
156 NextType::initializeFromArea(study, area);
162 NextType::initializeFromAreaLink(study, link);
165 void simulationBegin()
168 NextType::simulationBegin();
173 NextType::simulationEnd();
176 void yearBegin(uint year,
unsigned int numSpace)
179 pValuesForTheCurrentYear[numSpace].reset();
181 NextType::yearBegin(year, numSpace);
184 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
187 NextType::yearEndBuild(state, year, numSpace);
190 void yearEnd(uint year,
unsigned int numSpace)
193 pValuesForTheCurrentYear[numSpace].computeAveragesForCurrentYearFromHourlyResults();
196 NextType::yearEnd(year, numSpace);
199 void computeSummary(
unsigned int year,
unsigned int numSpace)
205 NextType::computeSummary(year, numSpace);
208 void hourBegin(uint hourInTheYear)
211 NextType::hourBegin(hourInTheYear);
214 void hourForEachArea(
State& state,
unsigned int numSpace)
219 pValuesForTheCurrentYear[numSpace][state.hourInTheYear] -= state.hourlyResults
220 ->CoutsMarginauxHoraires
221 [state.hourInTheWeek];
223 NextType::hourForEachArea(state, numSpace);
226 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
228 unsigned int numSpace)
const
230 return pValuesForTheCurrentYear[numSpace].hour;
233 void localBuildAnnualSurveyReport(SurveyResults&
results,
236 unsigned int numSpace)
const
239 results.isCurrentVarNA = AncestorType::isNonApplicable;
241 if (AncestorType::isPrinted[0])
246 pValuesForTheCurrentYear[numSpace]
247 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
253 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
254 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 Price.
Definition: price.h:95
Variable::IVariable< Price< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: price.h:102
@ count
How many items have we got.
Definition: price.h:112
VCardType::ResultsType ResultsType
List of expected results.
Definition: price.h:105
NextT NextType
Type of the next static variable.
Definition: price.h:98
VCardPrice VCardType
VCard.
Definition: price.h:100
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 constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: price.h:81
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: price.h:62
static constexpr uint8_t precision
Precision (views)
Definition: price.h:66
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: price.h:60
static constexpr uint8_t decimal
Decimal precision.
Definition: price.h:70
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: price.h:68
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: price.h:72
static std::string Description()
The short description of the variable.
Definition: price.h:43
VCardPrice VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: price.h:57
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: price.h:54
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: price.h:74
static std::string Unit()
Unit.
Definition: price.h:37
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: price.h:79
static std::string Caption()
Caption.
Definition: price.h:31
Definition: stdDeviation.h:33