Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
area.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_AREA_H__
22#define __SOLVER_VARIABLE_AREA_H__
23
24#include "state.h"
25
26namespace Antares
27{
28namespace Solver
29{
30namespace Variable
31{
33{
35 static std::string Caption()
36 {
37 return "Areas";
38 }
39
41 static std::string Unit()
42 {
43 return "";
44 }
45
47 static std::string Description()
48 {
49 return "";
50 }
51
54
56 static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
58 static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
59 & Category::FileLevel::de;
61 static constexpr uint8_t nodeDepthForGUI = +1;
63 static constexpr int columnCount = 0;
65 static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
67 static constexpr uint8_t hasIntermediateValues = 0;
68
69}; // class VCard
70
71template<class NextT = Container::EndOfList>
72class Areas //: public Variable::IVariable<Areas<NextT>, NextT, VCardAllAreas>
73{
74public:
76 typedef NextT NextType;
80 // typedef Variable::IVariable<Areas<NextT>, NextT, VCardType> AncestorType;
81
84
85 enum
86 {
88 count = NextT::count,
89 };
90
91 template<int CDataLevel, int CFile>
93 {
94 enum
95 {
96 count = NextType::template Statistics < CDataLevel,
97 CFile > ::count
98 };
99 };
100
101public:
107 template<class PredicateT>
108 static void RetrieveVariableList(PredicateT& predicate);
109
110public:
112
113
116 Areas();
118 ~Areas();
120
121 void initializeFromStudy(Data::Study& study);
122 void initializeFromArea(Data::Study*, Data::Area*);
123 void initializeFromThermalCluster(Data::Study*, Data::Area*, Data::ThermalCluster*);
124 void initializeFromAreaLink(Data::Study*, Data::AreaLink*);
125
126 void simulationBegin();
127 void simulationEnd();
128
129 void yearBegin(uint year, uint numSpace);
130 // void yearEndBuildPrepareDataForEachThermalCluster(State& state, uint year);
131 // void yearEndBuildForEachThermalCluster(State& state, uint year);
132
133 void yearEndBuild(State& state, uint year, uint numSpace);
134
135 void yearEnd(uint year, uint numSpace);
136
137 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
138 unsigned int nbYearsForCurrentSummary);
139
140 void hourBegin(uint hourInTheYear);
141
142 void hourForEachArea(State& state, uint numSpace);
143 void hourForEachLink(State& state, uint numSpace);
144
145 void hourEnd(State& state, uint hourInTheYear);
146
147 void weekBegin(State& state);
148 void weekForEachArea(State& state, uint numSpace);
149 void weekEnd(State& state);
150
151 void buildSurveyReport(SurveyResults& results,
152 int dataLevel,
153 int fileLevel,
154 int precision) const;
155
156 void buildAnnualSurveyReport(SurveyResults& results,
157 int dataLevel,
158 int fileLevel,
159 int precision,
160 uint numSpace) const;
161
162 void buildDigest(SurveyResults&, int digestLevel, int dataLevel) const;
163
164 void beforeYearByYearExport(uint year, uint numSpace);
165
166 template<class I>
167 static void provideInformations(I& infos);
168
169 template<class V>
170 void yearEndSpatialAggregates(V&, uint, uint)
171 {
172 // do nothing
173 }
174
175 template<class V>
176 void computeSpatialAggregatesSummary(V&, std::map<unsigned int, unsigned int>&, unsigned int)
177 {
178 // do nothing
179 }
180
181 template<class V>
182 void simulationEndSpatialAggregates(V&)
183 {
184 // do nothing
185 }
186
187 template<class VCardSearchT, class O>
188 void computeSpatialAggregateWith(O& out);
189
190 template<class VCardSearchT, class O>
191 void computeSpatialAggregateWith(O& out, const Data::Area* area, uint numSpace);
192
193 template<class VCardToFindT>
194 const double* retrieveHourlyResultsForCurrentYear() const;
195
196 template<class VCardToFindT>
197 void retrieveResultsForArea(typename Storage<VCardToFindT>::ResultsType** result,
198 const Data::Area* area);
199
200 template<class VCardToFindT>
201 void retrieveResultsForThermalCluster(typename Storage<VCardToFindT>::ResultsType** result,
202 const Data::ThermalCluster* cluster);
203
204 template<class VCardToFindT>
205 void retrieveResultsForLink(typename Storage<VCardToFindT>::ResultsType** result,
206 const Data::AreaLink* link);
207
208private:
210 NextType* pAreas;
212 uint pAreaCount;
213
214}; // class Areas
215
216} // namespace Variable
217} // namespace Solver
218} // namespace Antares
219
220#include "area.hxx"
221
222#endif // __SOLVER_VARIABLE_AREA_H__
Definition for a single area.
Definition area.h:52
Definition study.h:61
A single thermal cluster.
Definition cluster.h:78
Areas()
Default Constructor.
Definition area.hxx:34
VCardAllAreas VCardType
VCard.
Definition area.h:78
VCardType::ResultsType ResultsType
Ancestor.
Definition area.h:83
static void RetrieveVariableList(PredicateT &predicate)
Retrieve the list of all individual variables.
Definition area.hxx:220
~Areas()
Destructor.
Definition area.hxx:298
@ count
How many items have we got.
Definition area.h:88
NextT NextType
Type of the next static variable.
Definition area.h:76
Definition results.h:48
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
Results ResultsType
The expecte results.
Definition area.h:53
static std::string Description()
The short description of the variable.
Definition area.h:47
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition area.h:63
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition area.h:58
static constexpr uint8_t categoryDataLevel
Data Level.
Definition area.h:56
static std::string Caption()
Caption.
Definition area.h:35
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition area.h:67
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition area.h:61
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition area.h:65
static std::string Unit()
Unit.
Definition area.h:41