21 #ifndef __SOLVER_VARIABLE_ECONOMY_FlowLinear_H__
22 #define __SOLVER_VARIABLE_ECONOMY_FlowLinear_H__
24 #include "../../variable.h"
26 namespace Antares::Solver::Variable::Economy
45 return "Flow assessed, over all MC years, through linear optimization";
60 & (Category::FileLevel::id
61 | Category::FileLevel::va);
72 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
73 static constexpr uint8_t spatialAggregatePostProcessing = 0;
80 typedef std::vector<IntermediateValues> IntermediateValuesType;
87 template<
class NextT = Container::EndOfList>
109 template<
int CDataLevel,
int CFile>
125 pNbYearsParallel = study.maxNbYearsInParallel;
132 pValuesForTheCurrentYear.resize(pNbYearsParallel);
133 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
135 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
139 NextType::initializeFromStudy(study);
145 NextType::initializeFromArea(study, area);
151 NextType::initializeFromAreaLink(study, link);
154 void simulationBegin()
156 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
158 pValuesForTheCurrentYear[numSpace].reset();
161 NextType::simulationBegin();
166 NextType::simulationEnd();
169 void yearBegin(uint year,
unsigned int numSpace)
172 pValuesForTheCurrentYear[numSpace].reset();
174 NextType::yearBegin(year, numSpace);
177 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
180 NextType::yearEndBuild(state, year, numSpace);
183 void yearEnd(
unsigned int year,
unsigned int numSpace)
186 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
189 NextType::yearEnd(year, numSpace);
192 void computeSummary(
unsigned int year,
unsigned int numSpace)
198 NextType::computeSummary(year, numSpace);
201 void hourBegin(uint hourInTheYear)
204 NextType::hourBegin(hourInTheYear);
207 void hourForEachArea(
State& state,
unsigned int numSpace)
210 NextType::hourForEachArea(state, numSpace);
213 void hourForEachLink(
State& state,
unsigned int numSpace)
216 pValuesForTheCurrentYear[numSpace].hour[state.hourInTheYear] += state.ntc.ValeurDuFlux
219 NextType::hourForEachLink(state, numSpace);
222 void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
224 if (dataLevel & Category::DataLevel::link)
226 if (digestLevel & Category::digestFlowLinear)
229 .entry[
results.data.link->from->index][
results.data.link->with->index]
232 .entry[
results.data.link->with->index][
results.data.link->from->index]
238 NextType::buildDigest(
results, digestLevel, dataLevel);
241 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
245 return pValuesForTheCurrentYear[numSpace].hour;
248 void localBuildAnnualSurveyReport(SurveyResults&
results,
254 results.isCurrentVarNA = AncestorType::isNonApplicable;
256 if (AncestorType::isPrinted[0])
261 pValuesForTheCurrentYear[numSpace]
262 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
268 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
269 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 FlowLinear.
Definition: flowLinear.h:89
VCardFlowLinear VCardType
VCard.
Definition: flowLinear.h:94
Variable::IVariable< FlowLinear< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: flowLinear.h:96
NextT NextType
Type of the next static variable.
Definition: flowLinear.h:92
VCardType::ResultsType ResultsType
List of expected results.
Definition: flowLinear.h:99
@ count
How many items have we got.
Definition: flowLinear.h:106
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: flowLinear.h:111
Definition: flowLinear.h:29
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: flowLinear.h:59
static std::string Unit()
Unit.
Definition: flowLinear.h:37
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: flowLinear.h:54
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: flowLinear.h:65
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: flowLinear.h:77
static constexpr uint8_t precision
Precision (views)
Definition: flowLinear.h:63
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: flowLinear.h:75
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: flowLinear.h:69
static std::string Caption()
Caption.
Definition: flowLinear.h:31
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: flowLinear.h:71
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: flowLinear.h:57
static std::string Description()
The short description of the variable.
Definition: flowLinear.h:43
static constexpr uint8_t decimal
Decimal precision.
Definition: flowLinear.h:67
Definition: stdDeviation.h:33