Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
ui-runtimeinfos.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#ifndef __ANTARES_LIBS_STUDY_UI_RUNTIME_INFOS_H__
22#define __ANTARES_LIBS_STUDY_UI_RUNTIME_INFOS_H__
23
24#include <yuni/yuni.h>
25#include <yuni/core/string.h>
26
27#include "antares/study/binding_constraint/BindingConstraintsRepository.h"
28
29#include "area/area.h"
30#include "binding_constraint/BindingConstraint.h"
31#include "fwd.h"
32
33namespace Antares
34{
35namespace Data
36{
37class UIRuntimeInfo final
38{
39public:
40 using VectorByType = std::map<enum BindingConstraint::Type,
42 using ByOperatorAndType = std::map<enum BindingConstraint::Operator, VectorByType>;
43
44public:
46
47
50 UIRuntimeInfo(Study& study);
51
54 {
55 }
56
58
62 void reloadAll();
63
67 void reload();
68
69 void reloadBindingConstraints();
70
74 uint linkCount() const
75 {
76 return pLinkCount;
77 }
78
82 uint clusterCount() const
83 {
84 return pClusterCount;
85 }
86
90 AreaLink* link(uint i)
91 {
92 assert(i < pLink.size());
93 return pLink[i];
94 }
95
96 const AreaLink* link(uint i) const
97 {
98 assert(i < pLink.size());
99 return pLink[i];
100 }
101
106 {
107 assert(i < pClusters.size());
108 return pClusters[i];
109 }
110
111 const ThermalCluster* cluster(uint i) const
112 {
113 assert(i < pClusters.size());
114 return pClusters[i];
115 }
116
117 BindingConstraint* constraint(uint i)
118 {
119 assert(i < pConstraint.size());
120 return pConstraint[i].get();
121 }
122
123 const BindingConstraint* constraint(uint i) const
124 {
125 assert(i < pConstraint.size());
126 return pConstraint[i].get();
127 }
128
129 uint constraintCount() const
130 {
131 return (uint)pConstraint.size();
132 }
133
134 uint countItems(BindingConstraint::Operator op, BindingConstraint::Type type);
135
136 uint visibleClustersCount(uint layerID);
137
138 uint visibleLinksCount(uint layerID);
139
140public:
142 Area::LinkMap orderedAreasAndLinks;
146 ByOperatorAndType byOperator;
149
150private:
151 Study& pStudy;
153 uint pClusterCount;
154 ThermalCluster::Vector pClusters;
156 uint pLinkCount;
157}; // class UIRuntimeInfo
158
159} // namespace Data
160} // namespace Antares
161
162#endif // __ANTARES_LIBS_STUDY_UI_RUNTIME_INFOS_H__
Type
Definition BindingConstraint.h:55
std::set< std::shared_ptr< BindingConstraint >, CompareBindingConstraintName > Set
Ordered Set of binding constraints.
Definition BindingConstraintsRepository.h:41
std::vector< std::shared_ptr< BindingConstraint > > Vector
Vector of binding constraints.
Definition BindingConstraintsRepository.h:39
Definition study.h:61
A single thermal cluster.
Definition cluster.h:78
std::vector< Data::ThermalCluster * > Vector
Vector of thermal clusters.
Definition cluster.h:114
Definition ui-runtimeinfos.h:38
AreaLink * link(uint i)
Get the link according a given index.
Definition ui-runtimeinfos.h:90
AreaLink::Vector pLink
Vector of pointers to links, in lexicographic order.
Definition ui-runtimeinfos.h:148
uint clusterCount() const
The total number of links in the clusters.
Definition ui-runtimeinfos.h:82
Area::LinkMap orderedAreasAndLinks
Areas ordered by their name + links ordered by their name.
Definition ui-runtimeinfos.h:142
~UIRuntimeInfo()
Destructor.
Definition ui-runtimeinfos.h:53
ByOperatorAndType byOperator
All binding constraints according their operator (<, > and = only)
Definition ui-runtimeinfos.h:146
BindingConstraintsRepository::Set orderedConstraint
Binding constraints ordered by their name.
Definition ui-runtimeinfos.h:144
void reloadAll()
Reload all informations about the study.
Definition ui-runtimeinfos.cpp:38
ThermalCluster * cluster(uint i)
Get the cluster according a given index.
Definition ui-runtimeinfos.h:105
uint linkCount() const
The total number of links in the study.
Definition ui-runtimeinfos.h:74
void reload()
Reload informations about the study.
Definition ui-runtimeinfos.cpp:44
UIRuntimeInfo(Study &study)
Constructor.
Definition ui-runtimeinfos.cpp:32