Antares Simulator
Power System Simulator
management.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 __ANTARES_SOLVER_HYDRO_MANAGEMENT_MANAGEMENT_H__
22 #define __ANTARES_SOLVER_HYDRO_MANAGEMENT_MANAGEMENT_H__
23 
24 #include <unordered_map>
25 
26 #include <antares/mersenne-twister/mersenne-twister.h>
27 #include <antares/study/area/area.h>
28 #include <antares/study/fwd.h>
29 #include <antares/study/parts/hydro/container.h>
30 #include "antares/date/date.h"
31 #include "antares/writer/i_writer.h"
32 
33 namespace Antares
34 {
35 namespace Solver
36 {
37 namespace Variable
38 {
39 class State;
40 }
41 
42 double randomReservoirLevel(double min, double avg, double max, MersenneTwister& random);
43 double BetaVariable(double a, double b, MersenneTwister& random);
44 double GammaVariable(double a, MersenneTwister& random);
45 
46 } // namespace Solver
47 
48 typedef struct
49 {
50  std::vector<double> HydrauliqueModulableQuotidien; /* indice par jour */
51  std::vector<double> NiveauxReservoirsDebutJours; // Niveaux (quotidiens) du reservoir de début
52  // de jour (en cas de gestion des reservoirs).
53  std::vector<double> NiveauxReservoirsFinJours; // Niveaux (quotidiens) du reservoir de fin
54  // de jour (en cas de gestion des reservoirs).
56 
57 using HYDRO_VENTILATION_RESULTS = std::vector<VENTILATION_HYDRO_RESULTS_BY_AREA>;
58 using HydroSpecificMap = std::unordered_map<const Antares::Data::Area*,
60 
61 class HydroManagement final
62 {
63 public:
64  HydroManagement(const Data::AreaList& areas,
65  const Data::Parameters& params,
66  const Date::Calendar& calendar,
67  Solver::IResultWriter& resultWriter);
68 
70  void makeVentilation(const std::vector<double>& randomReservoirLevel,
71  uint y,
72  Antares::Data::Area::ScratchMap& scratchmap);
73 
74  const HYDRO_VENTILATION_RESULTS& ventilationResults()
75  {
76  return ventilationResults_;
77  }
78 
79 private:
81  void prepareNetDemand(uint year,
82  Data::SimulationMode mode,
83  const Antares::Data::Area::ScratchMap& scratchmap,
84  HydroSpecificMap& hydro_specific_map);
86  void prepareEffectiveDemand(uint year, HydroSpecificMap& hydro_specific_map) const;
88  void prepareMonthlyOptimalGenerations(const std::vector<double>& random_reservoir_level,
89  uint y,
90  Antares::Data::Area::ScratchMap& scratchmap,
91  HydroSpecificMap& hydro_specific_map);
92 
93  void prepareDailyOptimalGenerations(uint y,
94  Antares::Data::Area::ScratchMap& scratchmap,
95  HydroSpecificMap& hydro_specific_map);
96 
97  void prepareDailyOptimalGenerations(
98  Data::Area& area,
99  uint y,
100  Antares::Data::Area::ScratchMap& scratchmap,
102 
103 private:
104  const Data::AreaList& areas_;
105  const Date::Calendar& calendar_;
106  const Data::Parameters& parameters_;
107  Solver::IResultWriter& resultWriter_;
108 
109  HYDRO_VENTILATION_RESULTS ventilationResults_;
110 }; // class HydroManagement
111 } // namespace Antares
112 
113 #endif // __ANTARES_SOLVER_HYDRO_MANAGEMENT_MANAGEMENT_H__
A list of areas.
Definition: area.h:365
Definition for a single area.
Definition: area.h:51
General data for a study.
Definition: parameters.h:51
Definition: date.h:180
Definition: management.h:62
void makeVentilation(const std::vector< double > &randomReservoirLevel, uint y, Antares::Data::Area::ScratchMap &scratchmap)
Perform the hydro ventilation.
Definition: management.cpp:269
MersenneTwister Pseudo random number generator.
Definition: mersenne-twister.h:41
Definition: i_writer.h:32
Definition: cbuilder.h:120
Definition: variable.h:25
Hydro Management Data for a given area.
Definition: container.h:57