Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
management.h
1/*
2** Copyright 2007-2024, 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
33namespace Antares
34{
35namespace Solver
36{
37namespace Variable
38{
39class State;
40}
41
42double randomReservoirLevel(double min, double avg, double max, MersenneTwister& random);
43double BetaVariable(double a, double b, MersenneTwister& random);
44double GammaVariable(double a, MersenneTwister& random);
45
46} // namespace Solver
47
48typedef 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
57using HYDRO_VENTILATION_RESULTS = std::vector<VENTILATION_HYDRO_RESULTS_BY_AREA>;
58using HydroSpecificMap = std::unordered_map<const Antares::Data::Area*,
60
61class HydroManagement final
62{
63public:
65 const Data::Parameters& params,
66 const Date::Calendar& calendar,
67 Solver::IResultWriter& resultWriter);
68
70 void makeVentilation(double* randomReservoirLevel,
71 uint y,
72 Antares::Data::Area::ScratchMap& scratchmap);
73
74 const HYDRO_VENTILATION_RESULTS& ventilationResults()
75 {
76 return ventilationResults_;
77 }
78
79private:
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 double* random_reservoir_level,
89 uint y,
90 HydroSpecificMap& hydro_specific_map);
91
93 // note: inflows may have two different types, if in swap mode or not
94 // \return The total inflow for the whole year
95 double prepareMonthlyTargetGenerations(
96 Data::Area& area,
99
100 void prepareDailyOptimalGenerations(uint y,
101 Antares::Data::Area::ScratchMap& scratchmap,
102 HydroSpecificMap& hydro_specific_map);
103
104 void prepareDailyOptimalGenerations(
105 Data::Area& area,
106 uint y,
107 Antares::Data::Area::ScratchMap& scratchmap,
109
110private:
111 const Data::AreaList& areas_;
112 const Date::Calendar& calendar_;
113 const Data::Parameters& parameters_;
114 Solver::IResultWriter& resultWriter_;
115
116 HYDRO_VENTILATION_RESULTS ventilationResults_;
117}; // class HydroManagement
118} // namespace Antares
119
120#endif // __ANTARES_SOLVER_HYDRO_MANAGEMENT_MANAGEMENT_H__
A list of areas.
Definition area.h:366
Definition for a single area.
Definition area.h:52
General data for a study.
Definition parameters.h:51
Definition date.h:180
Definition management.h:62
void makeVentilation(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:34
Definition cbuilder.h:120
Definition variable.h:25
Area Hydro Management Data for a given year.
Definition container.h:66
Hydro Management Data for a given area.
Definition container.h:59