Antares Simulator
Power System Simulator
TSnumberData.h
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 __LIBS_STUDY_SCENARIO_BUILDER_DATA_TS_NUMBER_H__
22 #define __LIBS_STUDY_SCENARIO_BUILDER_DATA_TS_NUMBER_H__
23 
24 #include "scBuilderDataInterface.h"
25 
26 namespace Antares::Data::ScenarioBuilder
27 {
32 {
33 public:
36 
37 public:
38  // We use default constructor and destructor
39 
41 
42 
45  bool reset(const Study& study) override;
46 
47 #ifdef BUILD_UI
51  void saveToINIFile(const Study& study, Yuni::IO::File::Stream& file) const override;
52 #endif
53 
61  void setTSnumber(uint index, uint year, uint value);
63 
64  uint width() const override;
65  uint height() const override;
66 
67  double get_value(uint x, uint y) const;
68  void set_value(uint x, uint y, uint value) const;
69 
70 protected:
71  virtual CString<512, false> get_prefix() const = 0;
72 
73  virtual uint get_tsGenCount(const Study& study) const = 0;
74 
75 protected:
78 
79 }; // class TSNumberData
80 
81 // class TSNumberData : inline functions
82 
83 inline uint TSNumberData::width() const
84 {
85  return pTSNumberRules.width;
86 }
87 
88 inline uint TSNumberData::height() const
89 {
90  return pTSNumberRules.height;
91 }
92 
93 inline double TSNumberData::get_value(uint x, uint y) const
94 {
95  return pTSNumberRules.entry[y][x];
96 }
97 
98 } // namespace Antares::Data::ScenarioBuilder
99 
100 #endif // __LIBS_STUDY_SCENARIO_BUILDER_DATA_TS_NUMBER_H__
Rules for TS numbers, for all years and a single timeseries.
Definition: TSnumberData.h:32
bool reset(const Study &study) override
Reset data from the study.
Definition: TSnumberData.cpp:30
void setTSnumber(uint index, uint year, uint value)
Assign a single value.
Definition: TSnumberData.cpp:68
MatrixType pTSNumberRules
All TS number overlay (0 if auto)
Definition: TSnumberData.h:77
Interface for scenario builder data (time series, hydro levels, ...)
Definition: scBuilderDataInterface.h:37
Definition: study.h:57
uint height
Height of the matrix.
Definition: matrix.h:443
ColumnType * entry
All entries of the matrix (bidimensional array)
Definition: matrix.h:445
uint width
Width of the matrix.
Definition: matrix.h:441