Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
predicate.hxx
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_TS_GENERATOR_XCAST_PREDICATE_HXX__
22#define __SOLVER_TS_GENERATOR_XCAST_PREDICATE_HXX__
23
24#include <cmath>
25
26#include <yuni/yuni.h>
27
28#include <antares/series/series.h>
29#include <antares/study/area/area.h>
30#include "antares/study/parts/load/prepro.h"
31
32namespace Antares
33{
34namespace TSGenerator
35{
36namespace Predicate
37{
38class Wind final
39{
40public:
41 static bool preproDataIsReader(const Data::Area& area)
42 {
43 return area.wind.prepro != NULL;
44 }
45
46 static const char* timeSeriesName()
47 {
48 return "wind";
49 }
50
51 bool accept(const Data::Area& area) const
52 {
53 assert(area.wind.prepro != NULL);
54 return !Utils::isZero(area.wind.prepro->xcast.capacity);
55 }
56
57 Data::TimeSeries::TS& matrix(Data::Area& area) const
58 {
59 return area.wind.series.timeSeries;
60 }
61
62 Data::XCast& xcastData(Data::Area& area) const
63 {
64 assert(area.wind.prepro != NULL);
65 return area.wind.prepro->xcast;
66 }
67
68 static const Data::Correlation& correlation(const Data::Study& study)
69 {
70 return study.preproWindCorrelation;
71 }
72
73 uint timeSeriesToGenerate(const Data::Study& study) const
74 {
75 return study.parameters.nbTimeSeriesWind;
76 }
77
78}; // class Wind
79
80class Load final
81{
82public:
83 static bool preproDataIsReader(const Data::Area& area)
84 {
85 return area.load.prepro != NULL;
86 }
87
88 static const char* timeSeriesName()
89 {
90 return "load";
91 }
92
93 bool accept(const Data::Area& area) const
94 {
95 assert(area.load.prepro != NULL);
96 return !Utils::isZero(area.load.prepro->xcast.capacity);
97 }
98
99 Data::TimeSeries::TS& matrix(Data::Area& area) const
100 {
101 return area.load.series.timeSeries;
102 }
103
104 Data::XCast& xcastData(Data::Area& area) const
105 {
106 assert(area.load.prepro != NULL);
107 return area.load.prepro->xcast;
108 }
109
110 static const Data::Correlation& correlation(const Data::Study& study)
111 {
112 return study.preproLoadCorrelation;
113 }
114
115 uint timeSeriesToGenerate(const Data::Study& study) const
116 {
117 return study.parameters.nbTimeSeriesLoad;
118 }
119
120}; // class Load
121
122class Solar final
123{
124public:
125 static bool preproDataIsReader(const Data::Area& area)
126 {
127 return area.solar.prepro != NULL;
128 }
129
130 static const char* timeSeriesName()
131 {
132 return "solar";
133 }
134
135 bool accept(const Data::Area& area) const
136 {
137 assert(area.solar.prepro != NULL);
138 return !Utils::isZero(area.solar.prepro->xcast.capacity);
139 }
140
141 Data::TimeSeries::TS& matrix(Data::Area& area) const
142 {
143 return area.solar.series.timeSeries;
144 }
145
146 Data::XCast& xcastData(Data::Area& area) const
147 {
148 assert(area.solar.prepro != NULL);
149 return area.solar.prepro->xcast;
150 }
151
152 static const Data::Correlation& correlation(const Data::Study& study)
153 {
154 return study.preproSolarCorrelation;
155 }
156
157 uint timeSeriesToGenerate(const Data::Study& study) const
158 {
159 return study.parameters.nbTimeSeriesSolar;
160 }
161
162}; // class Solar
163
164} // namespace Predicate
165} // namespace TSGenerator
166} // namespace Antares
167
168#endif // __SOLVER_TS_GENERATOR_XCAST_PREDICATE_HXX__
Definition for a single area.
Definition area.h:52
Definition correlation.h:35
Definition study.h:61
Definition xcast.h:35
Definition predicate.hxx:81
Definition predicate.hxx:123
Definition predicate.hxx:39