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