Antares Simulator
Power System Simulator
economy.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 __SOLVER_SIMULATION_ECONOMY_H__
22 #define __SOLVER_SIMULATION_ECONOMY_H__
23 
24 #include "antares/infoCollection/StudyInfoCollector.h"
25 #include "antares/solver/optimisation/OptimisationsSimulationTable.h"
26 #include "antares/solver/optimisation/weekly_optimization.h"
27 #include "antares/solver/simulation/opt_time_writer.h"
28 #include "antares/solver/simulation/solver.h" // for definition of type yearRandomNumbers
29 #include "antares/solver/variable/economy/all.h"
30 #include "antares/solver/variable/state.h"
31 #include "antares/solver/variable/variable.h"
32 
33 #include "base_post_process.h"
34 
35 namespace Antares::Solver::Simulation
36 {
37 class Economy
38 {
39 public:
41  static const char* Name()
42  {
43  return "economy";
44  }
45 
46  static constexpr Data::SimulationMode mode = Data::SimulationMode::Economy;
47 
48 public:
50 
51 
57  IResultWriter& resultWriter,
58  Simulation::ISimulationObserver& simulationObserver);
60  ~Economy() = default;
62 
63  Benchmarking::OptimizationInfo getOptimizationInfo() const;
64 
65 public:
71  bool preproOnly;
72 
73 protected:
74  void setNbPerformedYearsInParallel(uint nbMaxPerformedYearsInParallel);
75 
76  bool simulationBegin();
77 
78  bool year(Progression::Task& progression,
79  Variable::State& state,
80  uint numSpace,
81  yearRandomNumbers& randomForYear,
82  std::list<uint>& failedWeekList,
83  const HYDRO_VENTILATION_RESULTS&,
85  const Antares::Data::Area::ScratchMap& scratchmap);
86 
87  void incrementProgression(Progression::Task& progression);
88 
89  void simulationEnd();
90 
91  void initializeState(Variable::State& state, uint numSpace);
92  OptimisationsSimulationTable& getSimulationTable(uint numSpace);
93  std::string getSimulationTableHeader() const;
94 
95 private:
96  uint pNbWeeks;
97  uint pStartTime;
98  uint pNbMaxPerformedYearsInParallel;
99  std::vector<PROBLEME_HEBDO> pProblemesHebdo;
100  std::vector<Optimization::WeeklyOptimization> weeklyOptProblems_;
101  std::vector<std::unique_ptr<interfacePostProcessList>> postProcessesList_;
102  IResultWriter& resultWriter_;
103  std::reference_wrapper<Simulation::ISimulationObserver> simulationObserver_;
104 
105  std::vector<OptimisationsSimulationTable> simulationTables_;
106 }; // class Economy
107 
108 } // namespace Antares::Solver::Simulation
109 
110 #endif // __SOLVER_SIMULATION_ECONOMY_H__
Definition: study.h:57
Definition: i_writer.h:32
Definition: progression.h:89
Definition: economy.h:38
Data::Study & study
Current study.
Definition: economy.h:67
bool preproOnly
Prepro only.
Definition: economy.h:71
Economy(Data::Study &study, IResultWriter &resultWriter, Simulation::ISimulationObserver &simulationObserver)
Constructor.
Definition: economy.cpp:36
static const char * Name()
Name of the type of simulation.
Definition: economy.h:41
Solver::Variable::Economy::AllVariables variables
All variables.
Definition: economy.h:69
The ISimulationObserver class is an interface for observing the simulation.
Definition: ISimulationObserver.h:36
Static list for all output variables.
Definition: container.h:44
Definition: state.h:71
Definition: OptimisationsSimulationTable.h:31
Definition: opt_time_writer.h:30
Definition: StudyInfoCollector.h:61