Antares Simulator
Power System Simulator
base_post_process.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 #pragma once
22 
23 #include <memory>
24 #include <vector>
25 
26 #include "antares/solver/optimisation/opt_fonctions.h"
27 #include "antares/solver/simulation/sim_structure_probleme_economique.h"
28 
29 using namespace Antares::Data;
30 using namespace Antares::Date;
32 
33 namespace Antares::Solver::Simulation
34 {
35 
37 {
38  optRuntimeData(unsigned int y, unsigned int w, unsigned int h):
39  year(y),
40  week(w),
41  hourInTheYear(h)
42  {
43  }
44 
45  unsigned int year = 0;
46  unsigned int week = 0;
47  unsigned int hourInTheYear = 0;
48 };
49 
51 {
52 public:
53  virtual ~basePostProcessCommand() = default;
54  virtual void execute(const optRuntimeData& opt_runtime_data) = 0;
55 
56 protected:
57  // Memeber functions
58  basePostProcessCommand(PROBLEME_HEBDO* problemeHebdo);
59 
60  // Data members
61  PROBLEME_HEBDO* problemeHebdo_;
62 };
63 
65 {
66 public:
67  virtual ~interfacePostProcessList() = default;
68 
69  // gp : we should put all these arguments in a structure, so that we pass a structure
70  // gp : to the create(...) method, and to underlying calls to constructors.
71  // gp : In case we need new data for a new post process, we would not have to change
72  // gp : the constructors' signatures of the post process list classes.
73  static std::unique_ptr<interfacePostProcessList> create(AdqPatchParams& adqPatchParams,
74  PROBLEME_HEBDO* problemeHebdo,
75  uint numSpace,
76  AreaList& areas,
77  const Data::Parameters& params,
78  Calendar& calendar,
79  IResultWriter& resultWriter);
80  void runAll(const optRuntimeData& opt_runtime_data);
81 
82 protected:
83  // Member functions
84  interfacePostProcessList(PROBLEME_HEBDO* problemeHebdo, uint numSpace);
85 
86  // Data mambers
87  PROBLEME_HEBDO* const problemeHebdo_ = nullptr;
88  const unsigned int numSpace_;
89  std::vector<std::unique_ptr<basePostProcessCommand>> post_process_list;
90 };
91 
92 } // namespace Antares::Solver::Simulation
A list of areas.
Definition: area.h:365
General data for a study.
Definition: parameters.h:51
Definition: date.h:180
Definition: i_writer.h:32
Definition: base_post_process.h:51
Definition: adq-patch-params.h:114
Definition: base_post_process.h:37
Definition: sim_structure_probleme_economique.h:403