29 #include "../variable.h"
30 #include "max-mrg-utils.h"
32 namespace Antares::Solver::Variable::Economy
51 return "Max margin for CSR";
65 static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
68 & (Category::FileLevel::id
69 | Category::FileLevel::va);
80 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
81 static constexpr uint8_t spatialAggregatePostProcessing = 0;
88 typedef std::vector<IntermediateValues> IntermediateValuesType;
90 using IntermediateValuesTypeForSpatialAg = std::unique_ptr<IntermediateValuesBaseType[]>;
97 template<
bool WithSimplexT>
98 void PrepareMaxMRGFor(
const State& state,
double* opmrg, uint numSpace);
103 template<
class NextT = Container::EndOfList>
125 template<
int CDataLevel,
int CFile>
130 count = ((VCardType::categoryDataLevel & CDataLevel
141 pNbYearsParallel = study.maxNbYearsInParallel;
146 pValuesForTheCurrentYear.resize(pNbYearsParallel);
147 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
149 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
153 NextType::initializeFromStudy(study);
159 VariableAccessorType::InitializeAndReset(
results, study);
162 void yearBegin(
unsigned int year,
unsigned int numSpace)
165 pValuesForTheCurrentYear[numSpace].reset();
167 NextType::yearBegin(year, numSpace);
170 void yearEnd(
unsigned int year,
unsigned int numSpace)
173 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
176 NextType::yearEnd(year, numSpace);
179 void computeSummary(
unsigned int year,
unsigned int numSpace)
185 NextType::computeSummary(year, numSpace);
188 void weekForEachArea(
State& state,
unsigned int numSpace)
190 double* rawhourly = Memory::RawPointer(pValuesForTheCurrentYear[numSpace].hour);
193 MaxMrgCSRdataFactory maxMRGcsrDataFactory(state, numSpace);
194 MaxMRGinput maxMRGinput = maxMRGcsrDataFactory.data();
195 computeMaxMRG(rawhourly + state.hourInTheYear, maxMRGinput);
198 NextType::weekForEachArea(state, numSpace);
201 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
203 unsigned int numSpace)
const
205 return pValuesForTheCurrentYear[numSpace].hour;
208 void localBuildAnnualSurveyReport(SurveyResults&
results,
211 unsigned int numSpace)
const
214 results.isCurrentVarNA = AncestorType::isNonApplicable;
216 if (AncestorType::isPrinted[0])
221 pValuesForTheCurrentYear[numSpace]
222 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
228 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
229 unsigned int pNbYearsParallel;
Max MRG.
Definition: max-mrg-csr.h:105
VCardMAX_MRG_CSR VCardType
VCard.
Definition: max-mrg-csr.h:110
Variable::IVariable< MaxMrgCsr< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: max-mrg-csr.h:112
VCardType::ResultsType ResultsType
List of expected results.
Definition: max-mrg-csr.h:115
@ count
How many items have we got.
Definition: max-mrg-csr.h:122
NextT NextType
Type of the next static variable.
Definition: max-mrg-csr.h:108
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: max-mrg-csr.h:127
Definition: max-mrg-csr.h:35
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: max-mrg-csr.h:60
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: max-mrg-csr.h:79
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: max-mrg-csr.h:73
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: max-mrg-csr.h:83
static std::string Unit()
Unit.
Definition: max-mrg-csr.h:43
static std::string Description()
The short description of the variable.
Definition: max-mrg-csr.h:49
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: max-mrg-csr.h:77
static std::string Caption()
Caption.
Definition: max-mrg-csr.h:37
static constexpr uint8_t precision
Precision (views)
Definition: max-mrg-csr.h:71
VCardMAX_MRG_CSR VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: max-mrg-csr.h:63
static constexpr uint8_t decimal
Decimal precision.
Definition: max-mrg-csr.h:75
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: max-mrg-csr.h:67
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: max-mrg-csr.h:85
Definition: stdDeviation.h:33