Antares Simulator
Power System Simulator
dataSeries.h
1 
2 /*
3  * Copyright 2007-2025, RTE (https://www.rte-france.com)
4  * See AUTHORS.txt
5  * SPDX-License-Identifier: MPL-2.0
6  * This file is part of Antares-Simulator,
7  * Adequacy and Performance assessment for interconnected energy networks.
8  *
9  * Antares_Simulator is free software: you can redistribute it and/or modify
10  * it under the terms of the Mozilla Public Licence 2.0 as published by
11  * the Mozilla Foundation, either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Antares_Simulator is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * Mozilla Public Licence 2.0 for more details.
18  *
19  * You should have received a copy of the Mozilla Public Licence 2.0
20  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
21  */
22 
23 #pragma once
24 
25 #include <span>
26 #include <string>
27 
28 #include <antares/optimisation/linear-problem-api/IScenario.h>
29 
30 namespace Antares::Optimisation::LinearProblemDataImpl
31 {
32 
34 {
35 public:
36  virtual ~IDataSeries() = default;
37 
38  explicit IDataSeries(std::string name):
39  name_(std::move(name))
40  {
41  }
42 
43  [[nodiscard]] virtual double getData(
44  LinearProblemApi::IScenario::TimeSeriesNumber time_series_number,
45  unsigned int hour) const
46  = 0;
47 
48  [[nodiscard]] virtual std::span<const double> getData(
49  LinearProblemApi::IScenario::TimeSeriesNumber time_series_number,
50  unsigned firstHour,
51  unsigned lastHour) const
52  = 0;
53 
54  [[nodiscard]] std::string name() const
55  {
56  return name_;
57  }
58 
59 private:
60  std::string name_;
61 };
62 
63 } // namespace Antares::Optimisation::LinearProblemDataImpl