Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
links.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_LINKS_H__
22#define __ANTARES_LIBS_STUDY_LINKS_H__
23
24#include <set>
25
26#include <yuni/yuni.h>
27#include <yuni/core/noncopyable.h>
28#include <yuni/core/string.h>
29
30#include <antares/array/matrix.h>
31#include <antares/series/series.h>
32#include <antares/solver/ts-generator/prepro.h>
33#include <antares/study/version.h>
34#include <antares/writer/i_writer.h>
35
36#include "../fwd.h"
37
38namespace Antares
39{
40namespace Data
41{
42struct CompareLinkName;
43
49class AreaLink final: public Yuni::NonCopyable<AreaLink>
50{
51public:
53 using Vector = std::vector<AreaLink*>;
55 using Set = std::set<AreaLink*, CompareLinkName>;
57 using Map = std::map<AreaName, AreaLink*>;
58
59 using NamePair = std::pair<Yuni::String, Yuni::String>;
60
61public:
63
64
67 AreaLink();
69 ~AreaLink();
71
72 bool loadTimeSeries(const StudyVersion& version, const std::filesystem::path& folder);
73
74 void storeTimeseriesNumbers(Solver::IResultWriter& writer) const;
75
77
78
81 void detach();
83
85
86
92 void reverse();
93
94 void resetToDefaultValues();
95
101 bool forceReload(bool reload = false) const;
102
106 void markAsModified() const;
108
109 bool isVisibleOnLayer(const size_t& layerID) const;
110
111 Yuni::String getName() const;
112
113 bool isLinkPhysical() const;
114 void overrideTransmissionCapacityAccordingToGlobalParameter(GlobalTransmissionCapacities tc);
115
116private:
117 bool linkLoadTimeSeries_for_version_below_810(const std::filesystem::path& folder);
118 bool linkLoadTimeSeries_for_version_820_and_later(const std::filesystem::path& folder);
119 NamePair getNamePair() const;
120
121public:
123
124
129
132
134
135
140 TimeSeries directCapacities;
141 TimeSeries indirectCapacities;
142
145
147 bool usePST;
148
151
153 // previously called copper plate
154 LocalTransmissionCapacities transmissionCapacities;
156
158 AssetType assetType;
159
161
162
168 uint index;
177
179
180
181 Yuni::String comments;
185
187
188
193
195 int color[3];
197 StyleType style;
200
201 friend struct CompareLinkName;
202}; // class AreaLink
203
204struct CompareLinkName final
205{
206 inline bool operator()(const AreaLink* s1, const AreaLink* s2) const
207 {
208 return s1->getNamePair() < s2->getNamePair();
209 }
210};
211
212} // namespace Data
213} // namespace Antares
214
215#endif // __ANTARES_LIBS_STUDY_LINKS_H__
Definition for a single area.
Definition area.h:52
Version of a study.
Definition version.h:36
Definition series.h:42
This class is used to represent the generic time series.
Definition series.h:65
A n-by-n matrix.
Definition jit.h:30
Definition i_writer.h:34
Definition links.h:205