Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
cluster.hxx
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_PARTS_THERMAL_CLUSTER_HXX__
22#define __ANTARES_LIBS_STUDY_PARTS_THERMAL_CLUSTER_HXX__
23
24namespace Yuni
25{
26namespace Extension
27{
28namespace CString
29{
30template<class CStringT>
31class Append<CStringT, Antares::Data::StatisticalLaw>
32{
33public:
34 static void Perform(CStringT& string, Antares::Data::StatisticalLaw law)
35 {
36 switch (law)
37 {
38 case Antares::Data::LawUniform:
39 string += "uniform";
40 break;
41 case Antares::Data::LawGeometric:
42 string += "geometric";
43 break;
44 }
45 }
46};
47
48template<class CStringT>
49class Append<CStringT, Antares::Data::CostGeneration>
50{
51public:
52 static void Perform(CStringT& string, Antares::Data::CostGeneration costgeneration)
53 {
54 switch (costgeneration)
55 {
56 case Antares::Data::setManually:
57 string += "setManually";
58 break;
59 case Antares::Data::useCostTimeseries:
60 string += "useCostTimeseries";
61 break;
62 }
63 }
64};
65
66template<class CStringT>
67class Append<CStringT, Antares::Data::LocalTSGenerationBehavior>
68{
69public:
70 static void Perform(CStringT& string, Antares::Data::LocalTSGenerationBehavior behavior)
71 {
72 switch (behavior)
73 {
74 case Antares::Data::LocalTSGenerationBehavior::forceGen:
75 string += "force generation";
76 break;
77 case Antares::Data::LocalTSGenerationBehavior::forceNoGen:
78 string += "force no generation";
79 break;
80 default:
81 string += "use global";
82 break;
83 }
84 }
85};
86
87template<>
88class Into<Antares::Data::StatisticalLaw>
89{
90public:
91 using TargetType = Antares::Data::StatisticalLaw;
92
93 enum
94 {
95 valid = 1
96 };
97
98 static bool Perform(AnyString string, TargetType& out);
99
100 template<class StringT>
101 static TargetType Perform(const StringT& s)
102 {
103 TargetType law = Antares::Data::LawUniform;
104 Perform(s, law);
105 return law;
106 }
107};
108
109template<>
110class Into<Antares::Data::CostGeneration>
111{
112public:
113 using TargetType = Antares::Data::CostGeneration;
114 enum class Validation
115 {
116 valid = 1
117 };
118
119 static bool Perform(AnyString string, TargetType& out);
120
121 template<class StringT>
122 static TargetType Perform(const StringT& s)
123 {
124 TargetType costgeneration = Antares::Data::setManually;
125 Perform(s, costgeneration);
126 return costgeneration;
127 }
128};
129
130template<>
131class Into<Antares::Data::LocalTSGenerationBehavior>
132{
133public:
134 using TargetType = Antares::Data::LocalTSGenerationBehavior;
135
136 enum
137 {
138 valid = 1
139 };
140
141 static bool Perform(AnyString string, TargetType& out);
142
143 template<class StringT>
144 static TargetType Perform(const StringT& s)
145 {
146 TargetType behavior = Antares::Data::LocalTSGenerationBehavior::useGlobalParameter;
147 Perform(s, behavior);
148 return behavior;
149 }
150};
151
152} // namespace CString
153} // namespace Extension
154} // namespace Yuni
155
156#endif // __ANTARES_LIBS_STUDY_PARTS_THERMAL_CLUSTER_HXX__