21#ifndef __SOLVER_VARIABLE_ECONOMY_LMR_VIOLATIONS_H__
22#define __SOLVER_VARIABLE_ECONOMY_LMR_VIOLATIONS_H__
24#include "antares/solver/variable/variable.h"
26namespace Antares::Solver::Variable::Economy
45 return "Local Matching Rule is violated more than the provided threshold";
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;
90template<
class NextT = Container::EndOfList>
112 template<
int CDataLevel,
int CFile>
127 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 VariableAccessorType::InitializeAndReset(
results, study);
151 NextType::initializeFromArea(study, area);
157 NextType::initializeFromAreaLink(study, link);
160 void simulationBegin()
162 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
164 pValuesForTheCurrentYear[numSpace].reset();
167 NextType::simulationBegin();
172 NextType::simulationEnd();
175 void yearBegin(
unsigned int year,
unsigned int numSpace)
178 pValuesForTheCurrentYear[numSpace].reset();
180 NextType::yearBegin(year, numSpace);
183 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
186 NextType::yearEndBuild(state, year, numSpace);
189 void yearEnd(
unsigned int year,
unsigned int numSpace)
192 pValuesForTheCurrentYear[numSpace].computeStatisticsForTheCurrentYear();
195 NextType::yearEnd(year, numSpace);
198 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
199 unsigned int nbYearsForCurrentSummary)
201 for (
unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace)
205 pValuesForTheCurrentYear[numSpace]);
209 NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary);
212 void hourBegin(
unsigned int hourInTheYear)
215 NextType::hourBegin(hourInTheYear);
218 void hourForEachArea(
State& state,
unsigned int numSpace)
221 pValuesForTheCurrentYear[numSpace][state.hourInTheYear] = state.hourlyResults
222 ->ValeursHorairesLmrViolations
223 [state.hourInTheWeek];
226 NextType::hourForEachArea(state, numSpace);
229 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
231 unsigned int numSpace)
const
233 return pValuesForTheCurrentYear[numSpace].hour;
236 void localBuildAnnualSurveyReport(SurveyResults&
results,
239 unsigned int numSpace)
const
242 results.isCurrentVarNA = AncestorType::isNonApplicable;
244 if (AncestorType::isPrinted[0])
249 pValuesForTheCurrentYear[numSpace]
250 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
256 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
257 unsigned int pNbYearsParallel;
Definition of a link between two areas (Interconnection)
Definition links.h:50
Definition for a single area.
Definition area.h:52
C02 Average value of the overrall CO2 emissions expected from all the thermal dispatchable clusters.
Definition localMatchingRuleViolations.h:92
Variable::IVariable< LMRViolations< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition localMatchingRuleViolations.h:99
VCardLMRViolations VCardType
VCard.
Definition localMatchingRuleViolations.h:97
NextT NextType
Type of the next static variable.
Definition localMatchingRuleViolations.h:95
VCardType::ResultsType ResultsType
List of expected results.
Definition localMatchingRuleViolations.h:102
@ count
How many items have we got.
Definition localMatchingRuleViolations.h:109
Interface for any variable.
Definition variable.h:51
const StoredResultType & results() const
Definition variable.hxx:544
StoredResultType pResults
All the results about this variable.
Definition variable.h:327
@ count
The count if item in the list.
Definition results.h:56
Definition cbuilder.h:120
Definition localMatchingRuleViolations.h:114
Definition localMatchingRuleViolations.h:29
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition localMatchingRuleViolations.h:69
static constexpr uint8_t decimal
Decimal precision.
Definition localMatchingRuleViolations.h:67
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition localMatchingRuleViolations.h:59
Results< R::AllYears::Average< > > ResultsType
The expecte results.
Definition localMatchingRuleViolations.h:51
static std::string Description()
The short description of the variable.
Definition localMatchingRuleViolations.h:43
static std::string Caption()
Caption.
Definition localMatchingRuleViolations.h:31
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition localMatchingRuleViolations.h:75
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition localMatchingRuleViolations.h:77
static constexpr uint8_t categoryDataLevel
Data Level.
Definition localMatchingRuleViolations.h:57
static std::string Unit()
Unit.
Definition localMatchingRuleViolations.h:37
VCardLMRViolations VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition localMatchingRuleViolations.h:54
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition localMatchingRuleViolations.h:71
static constexpr uint8_t precision
Precision (views)
Definition localMatchingRuleViolations.h:63
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition localMatchingRuleViolations.h:65