Antares Simulator
Power System Simulator
finalLevelValidator.h
1 /*
2 ** Copyright 2007-2023 RTE
3 ** Authors: Antares_Simulator Team
4 **
5 ** This file is part of Antares_Simulator.
6 **
7 ** Antares_Simulator is free software: you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License as published by
9 ** the Free Software Foundation, either version 3 of the License, or
10 ** (at your option) any later version.
11 **
12 ** There are special exceptions to the terms and conditions of the
13 ** license as they are applied to this software. View the full text of
14 ** the exceptions in file COPYING.txt in the directory of this software
15 ** distribution
16 **
17 ** Antares_Simulator is distributed in the hope that it will be useful,
18 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ** GNU General Public License for more details.
21 **
22 ** You should have received a copy of the GNU General Public License
23 ** along with Antares_Simulator. If not, see <http://www.gnu.org/licenses/>.
24 **
25 ** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions
26 */
27 #pragma once
28 
29 #include "antares/solver/hydro/management/HydroErrorsCollector.h"
30 #include "antares/study/parts/hydro/container.h"
31 
32 namespace Antares
33 {
34 namespace Data
35 {
36 class PartHydro;
37 }
38 
39 namespace Solver
40 {
42 {
43 public:
45  const Antares::Data::AreaName areaName,
46  double initialLevel,
47  double finalLevel,
48  const unsigned int year,
49  const unsigned int lastSimulationDay,
50  const unsigned int firstMonthOfSimulation,
51  HydroErrorsCollector& errorCollector);
52  bool check();
53  bool finalLevelFineForUse() const;
54 
55 private:
56  bool wasSetInScenarioBuilder();
57  bool compatibleWithReservoirProperties();
58  bool skippingFinalLevelUse();
59  bool checkForInfeasibility();
60  bool hydroAllocationStartMatchesSimulation() const;
61  bool isFinalLevelReachable() const;
62  double calculateTotalInflows() const;
63  bool isBetweenRuleCurves() const;
64 
65  // Data from simulation
66  unsigned int year_ = 0;
67  unsigned int lastSimulationDay_ = 0;
68  unsigned int firstMonthOfSimulation_ = 0;
69 
70  // Data from area
71  const Antares::Data::PartHydro& hydro_;
72  const Antares::Data::AreaName areaName_;
73  double initialLevel_;
74  double finalLevel_;
75 
76  bool finalLevelFineForUse_ = false;
77 
78  // area input errors
79  HydroErrorsCollector& errorCollector_;
80 };
81 } // namespace Solver
82 } // namespace Antares
Hydro for a single area.
Definition: container.h:86
Definition: HydroErrorsCollector.h:32
Definition: finalLevelValidator.h:42