Antares Simulator
Power System Simulator
singleProblemGetterImpl.h
1 
2 
3 #pragma once
4 
5 #include "antares/solver/hydro/management/management.h"
6 #include "antares/solver/lps/LpsFromAntares.h"
7 #include "antares/solver/optimisation/HebdoProblemToLpsTranslator.h"
8 #include "antares/solver/simulation/random.h"
9 #include "antares/solver/simulation/sim_structure_probleme_economique.h"
10 
11 namespace Antares::Solver::Implementation
12 {
13 
14 using HydroLevels = std::map<const Antares::Data::Area*, std::array<double, 53 /* TODO */>>;
15 
16 struct YearlyData
17 {
18  HydroLevels hydroLevels;
19  Antares::HYDRO_VENTILATION_RESULTS ventilationResults;
20 };
21 
22 using AllData = std::map<unsigned int /* year */, YearlyData>;
23 
25 {
26 public:
27  explicit SingleProblemGetter(const std::filesystem::path& studyPath);
28  explicit SingleProblemGetter(std::unique_ptr<Antares::Data::Study>&& study);
29  ConstantDataFromAntares getConstantData();
30  WeeklyDataFromAntares getWeeklyData(WeeklyProblemId id);
31  std::vector<WeeklyProblemId> getProblemIds() const;
32 
33  void writeNTCTimeSeries(const std::filesystem::path& outputDir);
34  void writeStudyDescriptionFiles(const std::filesystem::path& outputDir);
35 
36 private:
37  const YearlyData& getYearlyData(unsigned year);
38  YearlyData computeHydroLevels(unsigned year, const std::vector<double>& initialLevel);
39  void initializeRandomNumbers();
40  Antares::Data::Area::ScratchMap scratchmap_;
41  HebdoProblemToLpsTranslator translator_;
42  std::unique_ptr<Antares::Data::Study> study_;
43  PROBLEME_HEBDO pb_;
44  AllData allData_;
45  std::optional<Antares::Solver::Simulation::randomNumbers>
46  randomForParallelYears_; // Allow the use of std::optional<T>::emplace for delayed
47  // building
48 };
49 } // namespace Antares::Solver::Implementation
Definition for a single area.
Definition: area.h:51
Class for translating a weekly problem to a linear programming problem.
Definition: HebdoProblemToLpsTranslator.h:51
Definition: singleProblemGetterImpl.h:25
The ConstantDataFromAntares class is used to store constant data across all weeks of Antares problems...
Definition: LpsFromAntares.h:54
Definition: singleProblemGetterImpl.h:17
The WeeklyDataFromAntares class is used to store weekly data for an Antares Problem.
Definition: LpsFromAntares.h:89
The WeeklyProblemId struct is used to identify a weekly problem by year and week.
Definition: LpsFromAntares.h:37
Definition: sim_structure_probleme_economique.h:403