21 #ifndef __SOLVER_VARIABLE_ECONOMY_FlowQuad_H__
22 #define __SOLVER_VARIABLE_ECONOMY_FlowQuad_H__
24 #include "../../variable.h"
26 namespace Antares::Solver::Variable::Economy
45 return "Flow (quad.)";
57 & (Category::FileLevel::id
58 | Category::FileLevel::va);
69 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
70 static constexpr uint8_t spatialAggregatePostProcessing = 0;
83 template<
class NextT = Container::EndOfList>
105 template<
int CDataLevel,
int CFile>
126 pNbHours = study.runtime.rangeLimits.hour[Data::rangeEnd] + 1;
127 transitMoyenInterco_ = &study.runtime.transitMoyenInterconnexionsRecalculQuadratique;
132 pValuesForTheCurrentYear.initializeFromStudy(study);
135 NextType::initializeFromStudy(study);
141 NextType::initializeFromArea(study, area);
146 assert(link &&
"invalid interconnection");
147 pLinkGlobalIndex = link->index;
149 NextType::initializeFromAreaLink(study, link);
152 void simulationBegin()
154 pValuesForTheCurrentYear.
reset();
157 NextType::simulationBegin();
163 (void)::memcpy(pValuesForTheCurrentYear.
hour,
164 (*transitMoyenInterco_)[pLinkGlobalIndex].data(),
165 sizeof(double) * pNbHours);
173 NextType::simulationEnd();
176 void yearBegin(uint year,
unsigned int numSpace)
179 NextType::yearBegin(year, numSpace);
182 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
185 NextType::yearEndBuild(state, year, numSpace);
188 void yearEnd(uint year,
unsigned int numSpace)
191 NextType::yearEnd(year, numSpace);
194 void computeSummary(
unsigned int year,
unsigned int numSpace)
197 NextType::computeSummary(year, numSpace);
200 void hourBegin(uint hourInTheYear)
203 NextType::hourBegin(hourInTheYear);
206 void hourForEachArea(
State& state,
unsigned int numSpace)
209 NextType::hourForEachArea(state, numSpace);
212 void hourForEachLink(
State& state,
unsigned int numSpace)
215 NextType::hourForEachLink(state, numSpace);
218 void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
220 if (dataLevel & Category::DataLevel::link)
222 if (digestLevel & Category::digestFlowQuad)
225 .entry[
results.data.link->from->index][
results.data.link->with->index]
228 .entry[
results.data.link->with->index][
results.data.link->from->index]
233 NextType::buildDigest(
results, digestLevel, dataLevel);
236 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
240 return pValuesForTheCurrentYear.
hour;
243 void localBuildAnnualSurveyReport(SurveyResults&
results,
249 results.isCurrentVarNA = AncestorType::isNonApplicable;
251 if (AncestorType::isPrinted[0])
256 pValuesForTheCurrentYear.template buildAnnualSurveyReport<VCardType>(
results,
263 uint pLinkGlobalIndex;
265 std::vector<std::vector<double>>* transitMoyenInterco_;
268 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
Definition of a link between two areas (Interconnection)
Definition: links.h:58
Definition for a single area.
Definition: area.h:51
Marginal FlowQuad.
Definition: flowQuad.h:85
Variable::IVariable< FlowQuad< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: flowQuad.h:92
@ count
How many items have we got.
Definition: flowQuad.h:102
VCardFlowQuad VCardType
VCard.
Definition: flowQuad.h:90
NextT NextType
Type of the next static variable.
Definition: flowQuad.h:88
VCardType::ResultsType ResultsType
List of expected results.
Definition: flowQuad.h:95
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: flowQuad.h:107
Definition: flowQuad.h:29
static std::string Unit()
Unit.
Definition: flowQuad.h:37
Results< R::AllYears::Raw< > > ResultsType
The expecte results.
Definition: flowQuad.h:51
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: flowQuad.h:74
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: flowQuad.h:66
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: flowQuad.h:72
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: flowQuad.h:68
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: flowQuad.h:62
static std::string Description()
The short description of the variable.
Definition: flowQuad.h:43
static std::string Caption()
Caption.
Definition: flowQuad.h:31
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: flowQuad.h:56
static constexpr uint8_t decimal
Decimal precision.
Definition: flowQuad.h:64
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: flowQuad.h:54
static constexpr uint8_t precision
Precision (views)
Definition: flowQuad.h:60