Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
container.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_LIST_H__
22#define __SOLVER_VARIABLE_LIST_H__
23
24#include <yuni/yuni.h>
25#include <yuni/core/static/types.h>
26#include <yuni/core/string.h>
27
28#include <antares/logs/logs.h>
29
30#include "categories.h"
31#include "endoflist.h"
32#include "info.h"
33#include "surveyresults.h"
34
35namespace Antares::Solver::Variable::Container
36{
42template<class NextT = Container::EndOfList>
43class List: public NextT
44{
45public:
47 using NextType = NextT;
50
51 enum
52 {
54 count = NextT::count,
55 };
56
57public:
59
60
64
68 void initializeFromArea(Data::Study* study, Data::Area* area);
69
74
79 Data::Area* area,
80 Data::ThermalCluster* cluster);
82
84
85
88 void simulationBegin();
89
93 void simulationEnd();
95
97
98
103 void yearBegin(unsigned int year, unsigned int numSpace);
104
112 void yearEnd(unsigned int year, unsigned int numSpace);
113
114 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
115 unsigned int nbYearsForCurrentSummary);
116
117 template<class V>
118 void yearEndSpatialAggregates(V& allVars, unsigned int year, unsigned int numSpace);
119
120 template<class V, class SetT>
121 void yearEndSpatialAggregates(V& allVars, unsigned int year, const SetT& set);
122
123 template<class V>
124 void computeSpatialAggregatesSummary(V& allVars,
125 std::map<unsigned int, unsigned int>& numSpaceToYear,
126 unsigned int);
127
128 template<class V>
129 void simulationEndSpatialAggregates(V& allVars);
130
131 template<class V, class SetT>
132 void simulationEndSpatialAggregates(V& allVars, const SetT& set);
134
136
137
140 void hourBegin(unsigned int hourInTheYear);
141
142 void hourForEachArea(State& state, unsigned int numSpace);
143
144 void hourForEachLink(State& state);
145
146 void hourEnd(State& state, unsigned int hourInTheYear);
148
150
151 void weekBegin(State& state);
152
153 void weekEnd(State& state);
155
157
158 template<class SearchVCardT, class O>
159 void computeSpatialAggregateWith(O& out);
160
161 template<class SearchVCardT, class O>
162 void computeSpatialAggregateWith(O& out, const Data::Area* area, unsigned int numSpace);
163
164 template<class VCardToFindT>
165 void retrieveResultsForArea(typename Variable::Storage<VCardToFindT>::ResultsType** result,
166 const Data::Area* area);
167
168 template<class VCardToFindT>
169 void retrieveResultsForThermalCluster(
171 const Data::ThermalCluster* cluster);
172
173 template<class VCardToFindT>
174 void retrieveResultsForLink(typename Variable::Storage<VCardToFindT>::ResultsType** result,
175 const Data::AreaLink* link);
177
179
180
183 void buildSurveyReport(SurveyResults& results,
184 int dataLevel,
185 int fileLevel,
186 int precision) const;
187
188 void buildAnnualSurveyReport(SurveyResults& results,
189 int dataLevel,
190 int fileLevel,
191 int precision,
192 unsigned int numSpace) const;
193
200 void exportSurveyResults(bool global,
201 const Yuni::String& output,
202 unsigned int numSpace,
203 IResultWriter& writer);
204
208 void buildDigest(SurveyResults& results, int digestLevel, int dataLevel) const;
210
211private:
213 Data::Study* pStudy;
214
215}; // class List
216
217} // namespace Antares::Solver::Variable::Container
218
219#include "container.hxx"
220#include "surveyresults/reportbuilder.hxx"
221
222#endif // __SOLVER_VARIABLE_LIST_H__
Definition for a single area.
Definition area.h:52
Definition study.h:61
A single thermal cluster.
Definition cluster.h:78
Definition i_writer.h:34
Static list for all output variables.
Definition container.h:44
void simulationEnd()
Notify to all variables that the simulation has finished.
Definition container.hxx:77
void simulationBegin()
Notify to all variables that the simulation is about to begin.
Definition container.hxx:71
void yearBegin(unsigned int year, unsigned int numSpace)
Notify to all variables that a new year is about to start.
Definition container.hxx:83
void yearEnd(unsigned int year, unsigned int numSpace)
Notify to all variables that the year is now over.
Definition container.hxx:89
@ count
How many items have we got.
Definition container.h:54
void initializeFromStudy(Data::Study &study)
Initialize all output variables.
Definition container.hxx:39
void initializeFromLink(Data::Study *study, Data::AreaLink *link)
Initialize all output variables according a given link.
Definition container.hxx:55
NextT NextType
Type of the next static variable.
Definition container.h:47
void initializeFromArea(Data::Study *study, Data::Area *area)
Initialize all output variables according a given area.
Definition container.hxx:48
void buildDigest(SurveyResults &results, int digestLevel, int dataLevel) const
Ask to all variables to fullfil the digest.
Definition container.hxx:285
void initializeFromThermalCluster(Data::Study *study, Data::Area *area, Data::ThermalCluster *cluster)
Initialize all output variables according a given thermal cluster.
Definition container.hxx:62
void hourBegin(unsigned int hourInTheYear)
Notify to all variables that a new hour is about to begin.
Definition container.hxx:147
void buildSurveyReport(SurveyResults &results, int dataLevel, int fileLevel, int precision) const
Ask to all variables to fullfil the report.
Definition container.hxx:226
void exportSurveyResults(bool global, const Yuni::String &output, unsigned int numSpace, IResultWriter &writer)
Ask to all variables to fullfil additional reports (like the digest for example)
Definition container.hxx:299
Class utility for building CSV results files.
Definition surveyresults.h:41
VariableAccessor< typenameVCardT::ResultsType, VCardT::columnCount >::Type ResultsType
The true type used for the results.
Definition info.h:764