Antares Simulator
Power System Simulator
intermediate.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_VARIABLE_STORAGE_INTERMEDIATE_H__
22 #define __SOLVER_VARIABLE_STORAGE_INTERMEDIATE_H__
23 
24 #include <yuni/yuni.h>
25 #include <yuni/core/string.h>
26 
27 #include <antares/study/study.h>
28 #include "antares/antares/constants.h"
29 
30 #include "../categories.h"
31 #include "../surveyresults.h"
32 
33 namespace Antares::Solver::Variable
34 {
41 class IntermediateValues final
42 {
43 public:
45  typedef double Type;
46 
47 public:
49 
50 
57 
58  void initializeFromStudy(Data::Study& study);
59 
63  void reset();
64 
69 
74 
79 
80  // Compute averages for the current year from a particular time division results :
81  // For instances :
82  // - compute averages daily to yearly, from hourly results
83  // - compute averages monthly to yearly, from weekly results
84  void computeAveragesForCurrentYearFromHourlyResults();
85  void computeAveragesForCurrentYearFromDailyResults();
86  void computeAveragesForCurrentYearFromWeeklyResults();
87 
92 
97 
102 
104 
105  template<class VCardT>
106  void buildAnnualSurveyReport(SurveyResults& report, int fileLevel, int precision) const;
108 
110 
111 
114  Type& operator[](const uint index);
115  const Type& operator[](const uint index) const;
117 
124 
126  Type month[MONTHS_PER_YEAR];
128  Type week[WEEKS_PER_YEAR];
130  Type day[DAYS_PER_YEAR];
132  mutable Antares::Memory::Stored<Type>::Type hour;
135 
136  template<uint Size, class VCardT, class A>
137  void internalExportAnnualValues(SurveyResults& report, const A& array, bool annual) const;
138 
139  void computeDailyAveragesForCurrentYear();
140  void computeWeeklyAveragesForCurrentYear();
141  void computeMonthlyAveragesForCurrentYear();
142  void computeYearlyAveragesForCurrentYear();
143 
144 }; // class IntermediateValues
145 
146 } // namespace Antares::Solver::Variable
147 
148 #include "intermediate.hxx"
149 
150 #endif // __SOLVER_VARIABLE_STORAGE_INTERMEDIATE_H__
Runtime informations.
Definition: runtime.h:69
Definition: study.h:57
Definition: date.h:180
Temporary buffer for allocating results for a single year.
Definition: intermediate.h:42
Type week[WEEKS_PER_YEAR]
Values for each week.
Definition: intermediate.h:128
Type & operator[](const uint index)
Vector alias for an hour in the year.
Antares::Data::StudyRuntimeInfos * pRuntimeInfo
Range.
Definition: intermediate.h:123
Type year
Year.
Definition: intermediate.h:134
void computeStatisticsAdequacyForTheCurrentYear()
Compute statistics for the current year.
Definition: intermediate.cpp:52
void adjustValuesWhenRelatedToAPrice()
Make another calculations when values are related to a price.
Definition: intermediate.cpp:357
void reset()
Reset all values.
Definition: intermediate.hxx:33
void computeProbabilitiesForTheCurrentYear()
Compute probabilities for the current year.
Definition: intermediate.cpp:283
Antares::Memory::Stored< Type >::Type hour
Values for each hour in the year.
Definition: intermediate.h:132
double Type
Basic type.
Definition: intermediate.h:45
Antares::Date::Calendar * calendar
Calendar, from the study, but dedicated to the output (with leap year)
Definition: intermediate.h:121
Antares::Data::StudyRangeLimits * pRange
Range.
Definition: intermediate.h:119
void computeStatisticsOrForTheCurrentYear()
Compute statistics for the current year.
Definition: intermediate.cpp:126
Type month[MONTHS_PER_YEAR]
Values for each month.
Definition: intermediate.h:126
IntermediateValues()
Constructor.
Definition: intermediate.cpp:33
void computeStatisticsForTheCurrentYear()
Compute statistics for the current year.
Definition: intermediate.cpp:70
void adjustValuesAdequacyWhenRelatedToAPrice()
Make another calculations when values are related to a price.
Definition: intermediate.cpp:387
Type day[DAYS_PER_YEAR]
Values for each day in the year.
Definition: intermediate.h:130
~IntermediateValues()
Destructor.
Definition: intermediate.hxx:28
Class utility for building CSV results files.
Definition: surveyresults.h:41
Definition: runtime.h:44