Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
setofareas.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#ifndef __SOLVER_VARIABLE_SET_OF_AREAS_H__
22#define __SOLVER_VARIABLE_SET_OF_AREAS_H__
23
24#include <antares/study/study.h>
25
26#include "state.h"
27
28namespace Antares
29{
30namespace Solver
31{
32namespace Variable
33{
35{
37 static std::string Caption()
38 {
39 return "Sets of Areas";
40 }
41
43 static std::string Unit()
44 {
45 return "";
46 }
47
49 static std::string Description()
50 {
51 return "";
52 }
53
56
58 static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
60 static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
61 & Category::FileLevel::de;
63 static constexpr uint8_t nodeDepthForGUI = +1;
65 static constexpr int columnCount = 0;
67 static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
69 static constexpr uint8_t hasIntermediateValues = 0;
70
71}; // class VCard
72
73template<class NextT = Container::EndOfList>
75{
76public:
78 typedef NextT NextType;
83
86
87 enum
88 {
90 count = NextT::count,
91 };
92
93 template<int CDataLevel, int CFile>
95 {
96 enum
97 {
98 count = NextType::template Statistics < CDataLevel,
99 CFile > ::count
100 };
101 };
102
103public:
109 template<class PredicateT>
110 static void RetrieveVariableList(PredicateT& predicate);
111
112public:
114
115
118 SetsOfAreas() = default;
120 ~SetsOfAreas() = default;
122
123 void initializeFromStudy(Data::Study& study);
124 void initializeFromArea(Data::Study*, Data::Area*);
125 void initializeFromThermalCluster(Data::Study*, Data::Area*, Data::ThermalCluster*);
126 void initializeFromAreaLink(Data::Study*, Data::AreaLink*);
127
128 void simulationBegin();
129 void simulationEnd();
130
131 void yearBegin(unsigned int year, unsigned int numSpace);
132
133 void yearEndBuild(State& state, unsigned int year, unsigned int numSpace);
134
135 void yearEnd(unsigned int year, unsigned int numSpace);
136
137 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
138 unsigned int nbYearsForCurrentSummary);
139
140 void hourBegin(unsigned int hourInTheYear);
141 void hourForEachArea(State& state, unsigned int numSpace);
142 void hourForEachLink(State& state);
143 void hourEnd(State& state, unsigned int hourInTheYear);
144
145 void weekBegin(State&);
146 void weekForEachArea(State&, unsigned int numSpace);
147 void weekEnd(State&);
148
149 void buildSurveyReport(SurveyResults& results,
150 int dataLevel,
151 int fileLevel,
152 int precision) const;
153
154 void buildAnnualSurveyReport(SurveyResults& results,
155 int dataLevel,
156 int fileLevel,
157 int precision,
158 unsigned int numSpace) const;
159
160 void buildDigest(SurveyResults&, int digestLevel, int dataLevel) const;
161
162 void beforeYearByYearExport(uint year, uint numSpace);
163
164 template<class I>
165 static void provideInformations(I& infos);
166
167 template<class V>
168 void yearEndSpatialAggregates(V& allVars, unsigned int year, unsigned int numSpace);
169
170 template<class V>
171 void computeSpatialAggregatesSummary(V& allVars,
172 std::map<unsigned int, unsigned int>& numSpaceToYear,
173 unsigned int);
174
175 template<class V>
176 void simulationEndSpatialAggregates(V& allVars);
177
178 template<class VCardSearchT, class O>
179 void computeSpatialAggregateWith(O& out);
180
181 template<class VCardSearchT, class O>
182 void computeSpatialAggregateWith(O& out, const Data::Area* area, uint numSpace);
183
184 template<class VCardToFindT>
185 const double* retrieveHourlyResultsForCurrentYear() const;
186
187 template<class VCardToFindT>
188 void retrieveResultsForArea(typename Storage<VCardToFindT>::ResultsType** result,
189 const Data::Area* area);
190
191 template<class VCardToFindT>
192 void retrieveResultsForThermalCluster(typename Storage<VCardToFindT>::ResultsType** result,
193 const Data::ThermalCluster* cluster);
194
195 template<class VCardToFindT>
196 void retrieveResultsForLink(typename Storage<VCardToFindT>::ResultsType** result,
197 const Data::AreaLink* link);
198
199public:
201 typedef std::vector<std::unique_ptr<NextType>> SetOfAreasVector;
205 std::vector<const Data::Sets::SetAreasType*> pOriginalSets;
208
209 typename Data::Study::SetsOfAreas::IDType::Vector pNames;
210
211}; // class SetsOfAreas
212
213} // namespace Variable
214} // namespace Solver
215} // namespace Antares
216
217#include "setofareas.hxx"
218
219#endif // __SOLVER_VARIABLE_SET_OF_AREAS_H__
Definition for a single area.
Definition area.h:52
Definition study.h:61
A single thermal cluster.
Definition cluster.h:78
Interface for any variable.
Definition variable.h:51
Definition results.h:48
Definition setofareas.h:75
SetOfAreasVector pSetsOfAreas
Area list.
Definition setofareas.h:203
@ count
How many items have we got.
Definition setofareas.h:90
const Data::Study * pStudy
The study.
Definition setofareas.h:207
std::vector< const Data::Sets::SetAreasType * > pOriginalSets
Reference to the origina set.
Definition setofareas.h:205
VCardAllSetsOfAreas VCardType
VCard.
Definition setofareas.h:80
NextT NextType
Type of the next static variable.
Definition setofareas.h:78
static void RetrieveVariableList(PredicateT &predicate)
Retrieve the list of all individual variables.
Definition setofareas.hxx:377
SetsOfAreas()=default
Default Constructor.
Variable::IVariable< SetsOfAreas< NextT >, NextT, VCardType > AncestorType
Ancestor.
Definition setofareas.h:82
std::vector< std::unique_ptr< NextType > > SetOfAreasVector
Area list.
Definition setofareas.h:201
VCardType::ResultsType ResultsType
List of expected results.
Definition setofareas.h:85
Class utility for building CSV results files.
Definition surveyresults.h:41
Definition variable.h:25
VariableAccessor< typenameVCardT::ResultsType, VCardT::columnCount >::Type ResultsType
The true type used for the results.
Definition info.h:764
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition setofareas.h:60
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition setofareas.h:69
static std::string Caption()
Caption.
Definition setofareas.h:37
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition setofareas.h:63
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition setofareas.h:65
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition setofareas.h:67
static std::string Description()
The short description of the variable.
Definition setofareas.h:49
static std::string Unit()
Unit.
Definition setofareas.h:43
static constexpr uint8_t categoryDataLevel
Data Level.
Definition setofareas.h:58
Results ResultsType
The expecte results.
Definition setofareas.h:55