Antares Simulator
Power System Simulator
generation.h
Go to the documentation of this file.
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 
40 #pragma once
41 
42 #include <algorithm>
43 #include <string_view>
44 
45 #include <antares/study/area/area.h>
46 
47 #include "timeseries_base.h"
48 
49 namespace Antares::Solver::Variable::Economy
50 {
51 
54 
60 struct SolarTag
61 {
62 };
63 
69 struct WindTag
70 {
71 };
72 
74 
77 
92 {
94  inline static constexpr std::string_view kCaption = "SOLAR";
96  inline static constexpr std::string_view kDescription = "Solar generation, thoughout all MC "
97  "years";
98  // Pointer-to-member for accessing solar data from Area
99  static constexpr auto areaMember = &Data::Area::solar;
100 };
101 
117 {
119  inline static constexpr std::string_view kCaption = "WIND";
121  inline static constexpr std::string_view kDescription = "Wind generation, thoughout all MC "
122  "years";
123  // Pointer-to-member for accessing wind data from Area
124  static constexpr auto areaMember = &Data::Area::wind;
125 };
126 
128 
131 
139 
147 
149 
152 
160 template<class Tag>
161 struct GenerationTraits; // primary template (undefined)
162 
168 template<>
170 {
171 };
172 
178 template<>
180 {
181 };
182 
189 template<class Tag>
191 
193 
196 
222 template<class TraitsType, class NextT = Container::EndOfList>
224  : public TimeSeriesValuesBase<TimeSeriesValuesGenerationImpl<TraitsType, NextT>,
225  NextT,
226  VCardTimeSeriesBase<TraitsType>>
227 {
228 public:
232  NextT,
235 
237 
246  {
247  isRenewableGenerationAggregated = study.parameters.renewableGeneration.isAggregated();
248  }
249 
267  void yearBeginImpl(unsigned int year, unsigned int space)
268  {
269  if (isRenewableGenerationAggregated)
270  {
271  // Type-safe access to area data using traits
272  auto& holder = (BaseType::areaPtr->*TraitsType::areaMember);
273  // Bulk copy of time series data for performance
274  std::copy_n(holder.series.getColumn(year),
275  holder.series.timeSeries.height,
276  BaseType::yearlyValues[space].hour);
277  }
278  }
279 
295  void hourForEachAreaImpl(State&, unsigned int)
296  {
297  // Default implementation - no specific action needed for generation
298  // Values are already copied in yearBeginImpl for performance
299  }
300 
301 private:
304 
310  bool isRenewableGenerationAggregated{true};
312 };
313 
315 
318 
339 template<class Tag, class NextT = Container::EndOfList>
341 
361 template<class NextT = Container::EndOfList>
363 
383 template<class NextT = Container::EndOfList>
385 
387 
388 } // namespace Antares::Solver::Variable::Economy
Wind::Container wind
Wind time-series and Wind prepro data.
Definition: area.h:257
Definition: study.h:57
Base implementation for time series variables using CRTP pattern.
Definition: timeseries_base.h:263
VCardType::IntermediateValuesType yearlyValues
Intermediate values for each parallel space.
Definition: timeseries_base.h:488
Common implementation for renewable generation time series.
Definition: generation.h:227
void initializeDerivedFromStudy(Data::Study &study)
Initialize generation-specific settings from study.
Definition: generation.h:245
void yearBeginImpl(unsigned int year, unsigned int space)
Setup generation data at the beginning of each year.
Definition: generation.h:267
void hourForEachAreaImpl(State &, unsigned int)
Hourly processing for generation variables.
Definition: generation.h:295
Definition: state.h:71
Primary template for generation traits mapping (undefined)
Definition: generation.h:161
Tag type for solar generation variables.
Definition: generation.h:61
Traits for solar generation time series.
Definition: generation.h:92
static constexpr std::string_view kCaption
Display name for solar generation in outputs and GUI.
Definition: generation.h:94
static constexpr std::string_view kDescription
Descriptive text (preserving original typo for stability)
Definition: generation.h:96
VCard template providing variable metadata and configuration.
Definition: timeseries_base.h:147
Tag type for wind generation variables.
Definition: generation.h:70
Traits for wind generation time series.
Definition: generation.h:117
static constexpr std::string_view kCaption
Display name for wind generation in outputs and GUI.
Definition: generation.h:119
static constexpr std::string_view kDescription
Descriptive text (preserving original typo for stability)
Definition: generation.h:121
Base classes and traits for time series variables in Antares Simulator.