Antares Simulator
Power System Simulator
common-eco-adq.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_COMMON_ECONOMY_ADEQUACY_H__
22 #define __SOLVER_SIMULATION_COMMON_ECONOMY_ADEQUACY_H__
23 
24 #include <vector>
25 
26 #include <antares/study/study.h>
27 #include "antares/solver/optimisation/opt_fonctions.h"
28 #include "antares/solver/simulation/random.h"
29 #include "antares/solver/simulation/solver.h" // for definition of type yearRandomNumbers
30 #include "antares/solver/variable/economy/all.h"
31 #include "antares/solver/variable/economy/dispatchable-generation-margin.h" // for OP.MRG
32 #include "antares/solver/variable/variable.h"
33 
34 namespace Antares::Solver::Simulation
35 {
36 // We use the namespace 'economy' here. That means it is mandatory
37 // that adequacy has the same variable (to get the same type)
38 typedef Solver::Variable::Economy::VCardBalance AvgExchangeVCardBalance;
40 
49 void PrepareRandomNumbers(Data::Study& study,
50  PROBLEME_HEBDO& problem,
51  yearRandomNumbers& randomForYear);
52 
53 void SetInitialHydroLevel(Data::Study& study,
54  PROBLEME_HEBDO& problem,
55  const HYDRO_VENTILATION_RESULTS& hydroVentilationResults);
56 
57 void BuildThermalPartOfWeeklyProblem(Data::Study& study,
58  PROBLEME_HEBDO& problem,
59  const int PasDeTempsDebut,
60  const std::vector<std::vector<double>>& thermalNoises,
61  unsigned int year);
62 
71 bool ShouldUseQuadraticOptimisation(const Data::Study& study);
72 
76 void ComputeFlowQuad(Data::Study& study,
77  PROBLEME_HEBDO& problem,
78  const std::vector<AvgExchangeResults*>& balance,
79  unsigned int nbWeeks);
80 
88 void RemixHydroForAllAreas(const Data::AreaList& areas,
89  PROBLEME_HEBDO& problem,
90  const Data::Parameters& params,
91  uint numSpace,
92  uint hourInYear,
93  IResultWriter& resultWriter);
94 
95 /*
96 ** \brief Interpolates water values related to reservoir levels for outputs only
97 **
98 ** \param areas : the areas of study
99 ** \param problem The weekly problem, from the solver
100 *point of weekly simulation)
101 ** \param hourInYear The hour in the year of the first hour in the current week
102 **
103 ** For any hour, the computed water values are related to the beginning of the hour, not the end.
104 */
105 void interpolateWaterValue(const Data::AreaList& areas,
106  PROBLEME_HEBDO& problem,
107  const Date::Calendar& calendar,
108  int hourInTheYear);
109 
110 /*
111 ** \brief Updating the weekly simulation final reservoir level, to be used as a start for the next
112 *week.
113 **
114 ** \param areas : the areas of study
115 ** \param problem The weekly problem, from the solver
116 */
117 void updatingWeeklyFinalHydroLevel(const Data::AreaList& areas, PROBLEME_HEBDO& problem);
118 
119 /*
120 ** \brief Compute the weighted average NTC for a link
121 **
122 ** \param areas : the areas of study
123 ** \param link The link
124 ** \param Weighted average NTC for the direct direction
125 ** \param Weighted average NTC for the indirect direction
126 */
127 int retrieveAverageNTC(const Data::Study& study,
128  const Matrix<>& capacities,
129  const Data::TimeSeriesNumbers& tsNumbers,
130  std::vector<double>& avg);
131 
132 void finalizeOptimizationStatistics(PROBLEME_HEBDO& problem,
134 
135 void prepareClustersInMustRunMode(Data::Study& study,
136  Data::Area::ScratchMap& scratchmap,
137  uint year,
138  Data::SimulationMode mode);
139 
140 } // namespace Antares::Solver::Simulation
141 
142 #endif // __SOLVER_SIMULATION_COMMON_ECONOMY_ADEQUACY_H__
A list of areas.
Definition: area.h:365
General data for a study.
Definition: parameters.h:51
Definition: study.h:57
Definition: series.h:42
Definition: date.h:180
A n-by-n matrix.
Definition: matrix.h:44
Definition: state.h:71
VariableAccessor< typename VCardT::ResultsType, VCardT::columnCount >::Type ResultsType
The true type used for the results.
Definition: info.h:760
Definition: sim_structure_probleme_economique.h:403