21 #ifndef __SOLVER_VARIABLE_ECONOMY_MarginalCost_H__
22 #define __SOLVER_VARIABLE_ECONOMY_MarginalCost_H__
26 #include "../../variable.h"
28 namespace Antares::Solver::Variable::Economy
47 return "Decrease of the overall operating cost expected by a 1MW capacity reinforcement";
62 & (Category::FileLevel::id
63 | Category::FileLevel::va);
74 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
75 static constexpr uint8_t spatialAggregatePostProcessing = 0;
82 typedef std::vector<IntermediateValues> IntermediateValuesType;
89 template<
class NextT = Container::EndOfList>
111 template<
int CDataLevel,
int CFile>
127 pNbYearsParallel = study.maxNbYearsInParallel;
134 pValuesForTheCurrentYear.resize(pNbYearsParallel);
135 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
137 pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
141 NextType::initializeFromStudy(study);
147 NextType::initializeFromArea(study, area);
153 NextType::initializeFromAreaLink(study, link);
156 void simulationBegin()
159 NextType::simulationBegin();
164 NextType::simulationEnd();
167 void yearBegin(uint year,
unsigned int numSpace)
170 pValuesForTheCurrentYear[numSpace].reset();
172 NextType::yearBegin(year, numSpace);
175 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
178 NextType::yearEndBuild(state, year, numSpace);
181 void yearEnd(
unsigned int year,
unsigned int numSpace)
184 pValuesForTheCurrentYear[numSpace].computeAveragesForCurrentYearFromHourlyResults();
187 NextType::yearEnd(year, numSpace);
190 void computeSummary(
unsigned int year,
unsigned int numSpace)
196 NextType::computeSummary(year, numSpace);
199 void hourBegin(uint hourInTheYear)
202 NextType::hourBegin(hourInTheYear);
205 void hourForEachArea(
State& state,
unsigned int numSpace)
208 NextType::hourForEachArea(state, numSpace);
211 void hourForEachLink(
State& state,
unsigned int numSpace)
213 pValuesForTheCurrentYear[numSpace][state.hourInTheYear] = std::abs(
214 state.problemeHebdo->VariablesDualesDesContraintesDeNTC[state.hourInTheWeek]
215 .VariableDualeParInterconnexion[state.link->index]);
219 double flow = state.problemeHebdo->ValeursDeNTC[state.hourInTheWeek]
220 .ValeurDuFlux[state.link->index];
221 double flow_lowerbound = -state.problemeHebdo->ValeursDeNTC[state.hourInTheWeek]
222 .ValeurDeNTCExtremiteVersOrigine[state.link->index];
223 double flow_upperbound = state.problemeHebdo->ValeursDeNTC[state.hourInTheWeek]
224 .ValeurDeNTCOrigineVersExtremite[state.link->index];
226 if (flow - 0.001 > flow_lowerbound && flow + 0.001 < flow_upperbound)
228 pValuesForTheCurrentYear[numSpace][state.hourInTheYear] = 0.;
232 NextType::hourForEachLink(state, numSpace);
235 void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
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 MarginalCost.
Definition: marginalCost.h:91
NextT NextType
Type of the next static variable.
Definition: marginalCost.h:94
@ count
How many items have we got.
Definition: marginalCost.h:108
VCardMarginalCost VCardType
VCard.
Definition: marginalCost.h:96
VCardType::ResultsType ResultsType
List of expected results.
Definition: marginalCost.h:101
Variable::IVariable< MarginalCost< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: marginalCost.h:98
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: marginalCost.h:113
Definition: marginalCost.h:31
static constexpr uint8_t decimal
Decimal precision.
Definition: marginalCost.h:69
static std::string Caption()
Caption.
Definition: marginalCost.h:33
static constexpr uint8_t precision
Precision (views)
Definition: marginalCost.h:65
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition: marginalCost.h:71
static std::string Unit()
Unit.
Definition: marginalCost.h:39
static std::string Description()
The short description of the variable.
Definition: marginalCost.h:45
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: marginalCost.h:73
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: marginalCost.h:61
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: marginalCost.h:59
Results< R::AllYears::Average< R::AllYears::StdDeviation< R::AllYears::Min< R::AllYears::Max< > > > > > ResultsType
The expecte results.
Definition: marginalCost.h:56
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: marginalCost.h:79
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: marginalCost.h:77
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: marginalCost.h:67
Definition: stdDeviation.h:33