23 #include "antares/solver/variable/variable.h"
25 namespace Antares::Solver::Variable::Economy
32 return "MIN DTG by plant";
38 return "MIN GEN - MWh";
44 return "Min power by cluster";
59 & (Category::FileLevel::de);
70 static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
71 static constexpr uint8_t spatialAggregatePostProcessing = 0;
78 typedef std::vector<IntermediateValues> IntermediateValuesBaseType;
79 typedef std::vector<IntermediateValuesBaseType> IntermediateValuesType;
86 template<
class NextT = Container::EndOfList>
89 VCardMinDispatchableGenByPlant>
110 template<
int CDataLevel,
int CFile>
130 pNbYearsParallel = study->maxNbYearsInParallel;
131 pValuesForTheCurrentYear.resize(pNbYearsParallel);
134 nbClusters_ = area->thermal.list.enabledCount();
139 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
141 pValuesForTheCurrentYear[numSpace].resize(nbClusters_);
144 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
146 for (
unsigned int i = 0; i != nbClusters_; ++i)
148 pValuesForTheCurrentYear[numSpace][i].initializeFromStudy(*study);
152 for (
unsigned int i = 0; i != nbClusters_; ++i)
163 NextType::initializeFromArea(study, area);
166 size_t getMaxNumberColumns()
const
171 void yearBegin(
unsigned int year,
unsigned int numSpace)
174 for (
unsigned int i = 0; i != nbClusters_; ++i)
176 pValuesForTheCurrentYear[numSpace][i].reset();
179 NextType::yearBegin(year, numSpace);
182 void yearEnd(
unsigned int year,
unsigned int numSpace)
186 for (
unsigned int i = 0; i < nbClusters_; ++i)
189 pValuesForTheCurrentYear[numSpace][i].computeStatisticsForTheCurrentYear();
193 NextType::yearEnd(year, numSpace);
196 void computeSummary(
unsigned int year,
unsigned int numSpace)
198 for (
unsigned int i = 0; i < nbClusters_; ++i)
205 NextType::computeSummary(year, numSpace);
208 void hourForEachArea(
State& state,
unsigned int numSpace)
211 auto& area = state.area;
212 auto& thermal = state.thermal;
213 for (
auto& cluster: area->thermal.list.each_enabled())
215 double minGen = cluster->PthetaInf[state.hourInTheYear];
216 double production = thermal[area->index]
217 .thermalClustersProductions[cluster->enabledIndex];
219 pValuesForTheCurrentYear[numSpace][cluster->enabledIndex].hour[state.hourInTheYear]
220 += std::min(production, minGen);
224 NextType::hourForEachArea(state, numSpace);
227 inline void buildDigest(SurveyResults&
results,
int digestLevel,
int dataLevel)
const
230 NextType::buildDigest(
results, digestLevel, dataLevel);
233 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
235 unsigned int numSpace)
const
237 return pValuesForTheCurrentYear[numSpace][column].hour;
240 void localBuildAnnualSurveyReport(SurveyResults&
results,
243 unsigned int numSpace)
const
246 results.isCurrentVarNA = AncestorType::isNonApplicable;
248 if (AncestorType::isPrinted[0])
250 assert(NULL !=
results.data.area);
251 const auto& thermal =
results.data.area->thermal;
254 for (
auto& cluster: thermal.list.each_enabled())
257 results.variableCaption = cluster->name();
259 pValuesForTheCurrentYear[numSpace][cluster->enabledIndex]
260 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
267 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
268 size_t nbClusters_ = 0;
269 unsigned int pNbYearsParallel;
Definition for a single area.
Definition: area.h:51
Energy generated by all thermal dispatchable clusters.
Definition: minDispatchableGenByPlant.h:90
Variable::IVariable< MinDispatchableGenByPlant< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition: minDispatchableGenByPlant.h:97
VCardType::ResultsType ResultsType
List of expected results.
Definition: minDispatchableGenByPlant.h:100
@ count
How many items have we got.
Definition: minDispatchableGenByPlant.h:107
NextT NextType
Type of the next static variable.
Definition: minDispatchableGenByPlant.h:93
VCardMinDispatchableGenByPlant VCardType
VCard.
Definition: minDispatchableGenByPlant.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: minDispatchableGenByPlant.h:112
Definition: minDispatchableGenByPlant.h:28
static constexpr uint8_t categoryDataLevel
Data Level.
Definition: minDispatchableGenByPlant.h:56
VCardMinDispatchableGenByPlant VCardForSpatialAggregate
The VCard to look for for calculating spatial aggregates.
Definition: minDispatchableGenByPlant.h:53
static std::string Description()
The short description of the variable.
Definition: minDispatchableGenByPlant.h:42
static constexpr uint8_t precision
Precision (views)
Definition: minDispatchableGenByPlant.h:61
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition: minDispatchableGenByPlant.h:58
static constexpr uint8_t decimal
Decimal precision.
Definition: minDispatchableGenByPlant.h:65
static std::string Caption()
Caption.
Definition: minDispatchableGenByPlant.h:30
static constexpr int columnCount
Number of columns used by the variable.
Definition: minDispatchableGenByPlant.h:67
static constexpr uint8_t isPossiblyNonApplicable
Can this variable be non applicable (0 : no, 1 : yes)
Definition: minDispatchableGenByPlant.h:75
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition: minDispatchableGenByPlant.h:63
static std::string Unit()
Unit.
Definition: minDispatchableGenByPlant.h:36
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition: minDispatchableGenByPlant.h:73
Results< R::AllYears::Average< > > ResultsType
For synthesis.
Definition: minDispatchableGenByPlant.h:50
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition: minDispatchableGenByPlant.h:69