Antares Simulator
Power System Simulator
load.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 
32 #pragma once
33 
34 #include <cstring>
35 
36 #include "timeseries_base.h"
37 
38 namespace Antares::Solver::Variable::Economy
39 {
40 
52 struct LoadTraits
53 {
55  inline static constexpr std::string_view kCaption = "LOAD";
57  inline static constexpr std::string_view kDescription = "Load generation, thoughout all MC "
58  "years";
59 };
60 
74 
84 template<class NextT = Container::EndOfList>
86  : public TimeSeriesValuesBase<TimeSeriesValuesLoad<NextT>, NextT, VCardTimeSeriesValuesLoad>
87 {
88 public:
92  NextT,
94 
96 
102  {
103  // No specific initialization needed for load
104  // Load data is accessed directly and doesn't require
105  // special configuration like renewable generation aggregation
106  }
107 
134  void yearBeginImpl(unsigned int year, unsigned int space)
135  {
136  // The current time-series
137  //
138  // At this point, these values are not the raw values of the load timeseries
139  // see performTransformationsBeforeLaunchingSimulation()
140  // L* = L + DSM
141  //
142  std::memcpy(BaseType::yearlyValues[space].hour,
143  BaseType::areaPtr->load.series.getColumn(year),
144  sizeof(double) * BaseType::areaPtr->load.series.timeSeries.height);
145  }
146 
152  void hourForEachAreaImpl(State&, unsigned int)
153  {
154  // No specific action needed - values are already copied in yearBeginImpl
155  // This provides optimal performance by avoiding 8760 individual operations
156  // per year in favor of a single bulk memory copy.
157  }
158 };
159 
160 } // namespace Antares::Solver::Variable::Economy
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
Load time series implementation.
Definition: load.h:87
void yearBeginImpl(unsigned int year, unsigned int space)
Setup load data at the beginning of each year.
Definition: load.h:134
void hourForEachAreaImpl(State &, unsigned int)
Hourly processing for load variables.
Definition: load.h:152
void initializeDerivedFromStudy(Data::Study &)
Initialize load-specific settings from study Load variables currently don't require specific initiali...
Definition: load.h:101
Definition: state.h:71
Traits for load time series variables.
Definition: load.h:53
static constexpr std::string_view kDescription
Descriptive text for load time series.
Definition: load.h:57
static constexpr std::string_view kCaption
Display name for load in outputs and GUI.
Definition: load.h:55
VCard template providing variable metadata and configuration.
Definition: timeseries_base.h:147
Base classes and traits for time series variables in Antares Simulator.