Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
bindConstraints.h
1/*
2** Copyright 2007-2024, 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 "state.h"
24
25namespace Antares
26{
27namespace Solver
28{
29namespace Variable
30{
32{
34 static std::string Caption()
35 {
36 return "Binding constraints";
37 }
38
40 static std::string Unit()
41 {
42 return "";
43 }
44
46 static std::string Description()
47 {
48 return "";
49 }
50
53
55 static constexpr uint8_t categoryDataLevel = Category::DataLevel::bindingConstraint;
57 static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
58 & Category::FileLevel::bc;
60 static constexpr uint8_t nodeDepthForGUI = +1;
62 static constexpr int columnCount = 0;
64 static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
66 static constexpr uint8_t hasIntermediateValues = 0;
67
68}; // class VCardAllBindingConstraints
69
70template<class NextT = Container::EndOfList>
72{
73public:
75 typedef NextT NextType;
78
81
82 enum
83 {
85 count = NextT::count,
86 };
87
88 template<int CDataLevel, int CFile>
90 {
91 enum
92 {
93 count = NextType::template Statistics < CDataLevel,
94 CFile > ::count
95 };
96 };
97
98public:
104 template<class PredicateT>
105 static void RetrieveVariableList(PredicateT& predicate);
106
107public:
109
110
114
115 BindingConstraints(BindingConstraints& other) = delete;
116 BindingConstraints(BindingConstraints&& other) = delete;
117 const BindingConstraints& operator=(BindingConstraints&& other) = delete;
118
122
123 void initializeFromStudy(Data::Study& study);
124
125 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
126 unsigned int nbYearsForCurrentSummary);
127
128 void simulationBegin();
129 void simulationEnd();
130
131 void yearBegin(uint year, uint numSpace);
132 void yearEnd(uint year, uint numSpace);
133
134 void yearEndBuild(State& state, uint year, uint numSpace);
135
136 void weekBegin(State& state);
137 void weekEnd(State& state);
138 void weekForEachArea(State&, unsigned int numSpace);
139 void hourForEachArea(State&, unsigned int numSpace);
140
141 void hourBegin(uint hourInTheYear);
142 void hourEnd(State& state, uint hourInTheYear);
143
144 void buildSurveyReport(SurveyResults& results,
145 int dataLevel,
146 int fileLevel,
147 int precision) const;
148
149 void buildAnnualSurveyReport(SurveyResults& results,
150 int dataLevel,
151 int fileLevel,
152 int precision,
153 uint numSpace) const;
154
155 template<class V>
156 void yearEndSpatialAggregates(V&, uint, uint)
157 {
158 // do nothing
159 }
160
161 template<class I>
162 static void provideInformations(I& infos);
163
164 template<class VCardToFindT>
165 void retrieveResultsForArea(typename Storage<VCardToFindT>::ResultsType** result,
166 const Data::Area* area);
167 void buildDigest(SurveyResults&, int digestLevel, int dataLevel) const;
168
169 template<class V>
170 void simulationEndSpatialAggregates(V& allVars);
171
172 template<class VCardToFindT>
173 void retrieveResultsForLink(typename Storage<VCardToFindT>::ResultsType** result,
174 const Data::AreaLink* link);
175
176 template<class VCardToFindT>
177 void retrieveResultsForThermalCluster(typename Storage<VCardToFindT>::ResultsType** result,
178 const Data::ThermalCluster* cluster);
179 template<class VCardSearchT, class O>
180 void computeSpatialAggregateWith(O& out, const Data::Area* area, uint numSpace);
181 template<class V>
182 void computeSpatialAggregatesSummary(V& allVars,
183 std::map<unsigned int, unsigned int>& numSpaceToYear,
184 unsigned int);
185
186 void beforeYearByYearExport(uint year, uint numSpace);
187
188private:
189 // For each binding constraint, output variable static list associated.
190 std::vector<NextType> pBindConstraints;
191 // The number of counted binding constraints
192 uint pBCcount;
193
194}; // class Areas
195
196} // namespace Variable
197} // namespace Solver
198} // namespace Antares
199
200#include "bindConstraints.hxx"
Definition for a single area.
Definition area.h:52
Definition study.h:61
A single thermal cluster.
Definition cluster.h:78
Definition bindConstraints.h:72
VCardAllBindingConstraints VCardType
VCard.
Definition bindConstraints.h:77
static void RetrieveVariableList(PredicateT &predicate)
Retrieve the list of all individual variables.
Definition bindConstraints.hxx:74
BindingConstraints()=default
Default Constructor.
@ count
How many items have we got.
Definition bindConstraints.h:85
VCardType::ResultsType ResultsType
List of expected results.
Definition bindConstraints.h:80
NextT NextType
Type of the next static variable.
Definition bindConstraints.h:75
Definition results.h:48
Class utility for building CSV results files.
Definition surveyresults.h:41
Definition variable.h:25
VariableAccessor< typenameVCardT::ResultsType, VCardT::columnCount >::Type ResultsType
The true type used for the results.
Definition info.h:764
static constexpr uint8_t spatialAggregate
The Spatial aggregation.
Definition bindConstraints.h:64
static constexpr int columnCount
Number of columns used by the variable (One ResultsType per column)
Definition bindConstraints.h:62
static constexpr uint8_t hasIntermediateValues
Intermediate values.
Definition bindConstraints.h:66
static std::string Unit()
Unit.
Definition bindConstraints.h:40
static constexpr uint8_t categoryFileLevel
File level (provided by the type of the results)
Definition bindConstraints.h:57
Results ResultsType
The expecte results.
Definition bindConstraints.h:52
static std::string Caption()
Caption.
Definition bindConstraints.h:34
static std::string Description()
The short description of the variable.
Definition bindConstraints.h:46
static constexpr uint8_t nodeDepthForGUI
Indentation (GUI)
Definition bindConstraints.h:60
static constexpr uint8_t categoryDataLevel
Data Level.
Definition bindConstraints.h:55