GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 60.0% 3 / 0 / 5
Functions: 60.0% 3 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/LifeCycleCostParameters.hpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #ifndef MODEL_LIFECYCLECOSTPARAMETERS_HPP
7 #define MODEL_LIFECYCLECOSTPARAMETERS_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ParentObject.hpp"
11 #include "../utilities/core/Optional.hpp"
12
13 namespace openstudio {
14
15 class MonthOfYear;
16
17 namespace model {
18
19 namespace detail {
20 class LifeCycleCostParameters_Impl;
21 }
22
23 /** LifeCycleCostParameters derives from ParentObject and is an interface to the OpenStudio IDD object named "OS:LifeCycleCost:Parameters".
24 *
25 * LifeCycleCostParameters is a unique object which defines important parameters for life cycle analysis such as the length of the study,
26 * inflation rates, discounting convention, etc.
27 *
28 */
29 class MODEL_API LifeCycleCostParameters : public ParentObject
30 {
31 public:
32 /** @name Constructors and Destructors */
33 //@{
34 2685 virtual ~LifeCycleCostParameters() override = default;
35 // Default the copy and move operators because the virtual dtor is explicit
36 48 LifeCycleCostParameters(const LifeCycleCostParameters& other) = default;
37 849 LifeCycleCostParameters(LifeCycleCostParameters&& other) = default;
38 ✗ LifeCycleCostParameters& operator=(const LifeCycleCostParameters&) = default;
39 ✗ LifeCycleCostParameters& operator=(LifeCycleCostParameters&&) = default;
40
41 //@}
42 /** @name Getters */
43 //@{
44
45 static int nistYear();
46 static double fempRealDiscountRate();
47 static double fempNominalDiscountRate();
48 static double fempInflation();
49
50 std::string analysisType() const;
51
52 bool isAnalysisTypeDefaulted() const;
53
54 /// returns true if analysis type is FEMP
55 bool isFEMPAnalysis() const;
56
57 std::string discountingConvention() const;
58
59 bool isDiscountingConventionDefaulted() const;
60
61 std::string inflationApproach() const;
62
63 bool isInflationApproachDefaulted() const;
64
65 bool isConstantDollarAnalysis() const;
66
67 boost::optional<double> realDiscountRate() const;
68
69 boost::optional<double> nominalDiscountRate() const;
70
71 boost::optional<double> inflation() const;
72
73 MonthOfYear baseDateMonth() const;
74
75 bool isBaseDateMonthDefaulted() const;
76
77 int baseDateYear() const;
78
79 bool isBaseDateYearDefaulted() const;
80
81 MonthOfYear serviceDateMonth() const;
82
83 bool isServiceDateMonthDefaulted() const;
84
85 int serviceDateYear() const;
86
87 bool isServiceDateYearDefaulted() const;
88
89 int lengthOfStudyPeriodInYears() const;
90
91 bool isLengthOfStudyPeriodInYearsDefaulted() const;
92
93 boost::optional<double> taxRate() const;
94
95 std::string depreciationMethod() const;
96
97 bool isDepreciationMethodDefaulted() const;
98
99 bool useNISTFuelEscalationRates() const;
100
101 bool isUseNISTFuelEscalationRatesDefaulted() const;
102
103 boost::optional<std::string> nistRegion() const;
104
105 std::vector<std::string> validNistRegionValues() const;
106
107 bool isNISTRegionDefaulted() const;
108
109 boost::optional<std::string> nistSector() const;
110
111 std::vector<std::string> validNistSectorValues() const;
112
113 bool isNISTSectorDefaulted() const;
114
115 boost::optional<double> electricityInflation() const;
116
117 boost::optional<double> naturalGasInflation() const;
118
119 boost::optional<double> steamInflation() const;
120
121 boost::optional<double> gasolineInflation() const;
122
123 boost::optional<double> dieselInflation() const;
124
125 boost::optional<double> coalInflation() const;
126
127 boost::optional<double> fuelOil1Inflation() const;
128
129 boost::optional<double> fuelOil2Inflation() const;
130
131 boost::optional<double> propaneInflation() const;
132
133 boost::optional<double> waterInflation() const;
134
135 boost::optional<double> otherFuel1Inflation() const;
136
137 boost::optional<double> otherFuel2Inflation() const;
138
139 //@}
140 /** @name Setters */
141
142 bool setAnalysisType(const std::string& analysisType);
143
144 void resetAnalysisType();
145
146 bool setDiscountingConvention(const std::string& discountingConvention);
147
148 void resetDiscountingConvention();
149
150 bool setInflationApproach(const std::string& inflationApproach);
151
152 void resetInflationApproach();
153
154 /// This cannot be set when analysis type is FEMP or when inflation approach is "CurrentDollar"
155 bool setRealDiscountRate(double realDiscountRate);
156
157 /// This cannot be set when analysis type is FEMP or when inflation approach is "ConstantDollar"
158 bool setNominalDiscountRate(double nominalDiscountRate);
159
160 /// This cannot be set when analysis type is FEMP or when inflation approach is "ConstantDollar"
161 bool setInflation(double inflation);
162
163 bool setBaseDateMonth(const MonthOfYear& baseDateMonth);
164
165 void resetBaseDateMonth();
166
167 bool setBaseDateYear(int baseDateYear);
168
169 void resetBaseDateYear();
170
171 bool setServiceDateMonth(const MonthOfYear& serviceDateMonth);
172
173 void resetServiceDateMonth();
174
175 bool setServiceDateYear(int serviceDateYear);
176
177 void resetServiceDateYear();
178
179 /// This cannot be set greater than 25 years when analysis type is FEMP.
180 /// This cannot be set greater than 30 years when using NIST fuel escalation rates.
181 bool setLengthOfStudyPeriodInYears(int lengthOfStudyPeriodInYears);
182
183 void resetLengthOfStudyPeriodInYears();
184
185 bool setTaxRate(double taxRate);
186
187 void resetTaxRate();
188
189 bool setDepreciationMethod(const std::string& depreciationMethod);
190
191 void resetDepreciationMethod();
192
193 /// This cannot be set when analysis type is FEMP
194 bool setUseNISTFuelEscalationRates(bool useNISTFuelEscalationRates);
195
196 void resetUseNISTFuelEscalationRates();
197
198 /// This cannot be set when use NIST fuel escalation rates is false
199 bool setNISTRegion(const std::string& nistRegion);
200
201 void resetNISTRegion();
202
203 /// This cannot be set when use NIST fuel escalation rates is false
204 bool setNISTSector(const std::string& nistSector);
205
206 void resetNISTSector();
207
208 /// This cannot be set when use NIST fuel escalation rates is true
209 bool setElectricityInflation(double electricityInflation);
210
211 void resetElectricityInflation();
212
213 /// This cannot be set when use NIST fuel escalation rates is true
214 bool setNaturalGasInflation(double naturalGasInflation);
215
216 void resetNaturalGasInflation();
217
218 /// This cannot be set when use NIST fuel escalation rates is true
219 bool setSteamInflation(double steamInflation);
220
221 void resetSteamInflation();
222
223 /// This cannot be set when use NIST fuel escalation rates is true
224 bool setGasolineInflation(double gasolineInflation);
225
226 void resetGasolineInflation();
227
228 /// This cannot be set when use NIST fuel escalation rates is true
229 bool setDieselInflation(double dieselInflation);
230
231 void resetDieselInflation();
232
233 /// This cannot be set when use NIST fuel escalation rates is true
234 bool setCoalInflation(double coalInflation);
235
236 void resetCoalInflation();
237
238 /// This cannot be set when use NIST fuel escalation rates is true
239 bool setFuelOil1Inflation(double fuelOil1Inflation);
240
241 void resetFuelOil1Inflation();
242
243 /// This cannot be set when use NIST fuel escalation rates is true
244 bool setFuelOil2Inflation(double fuelOil2Inflation);
245
246 void resetFuelOil2Inflation();
247
248 /// This cannot be set when use NIST fuel escalation rates is true
249 bool setPropaneInflation(double propaneInflation);
250
251 void resetPropaneInflation();
252
253 /// This cannot be set when use NIST fuel escalation rates is true
254 bool setWaterInflation(double waterInflation);
255
256 void resetWaterInflation();
257
258 /// This cannot be set when use NIST fuel escalation rates is true
259 bool setOtherFuel1Inflation(double otherFuel1Inflation);
260
261 void resetOtherFuel1Inflation();
262
263 /// This cannot be set when use NIST fuel escalation rates is true
264 bool setOtherFuel2Inflation(double otherFuel2Inflation);
265
266 void resetOtherFuel2Inflation();
267
268 //@}
269
270 /// Returns the IddObjectType.
271 static IddObjectType iddObjectType();
272
273 /// Returns allowable values for analysisType.
274 static std::vector<std::string> validAnalysisTypeValues();
275
276 /// Returns allowable values for discountingConvention.
277 static std::vector<std::string> validDiscountingConventionValues();
278
279 /// Returns allowable values for inflationApproach.
280 static std::vector<std::string> validInflationApproachValues();
281
282 /// Returns allowable values for depreciationMethod.
283 static std::vector<std::string> validDepreciationMethodValues();
284
285 protected:
286 /** @name Constructors and Destructors */
287 //@{
288
289 /// Constructs a new LifeCycleCostParameters object in the model.
290 explicit LifeCycleCostParameters(const Model& model);
291
292 //@}
293
294 /// @cond
295
296 using ImplType = detail::LifeCycleCostParameters_Impl;
297
298 friend class Model;
299 friend class IdfObject;
300
301 // constructor
302 explicit LifeCycleCostParameters(std::shared_ptr<detail::LifeCycleCostParameters_Impl> impl);
303
304 private:
305 REGISTER_LOGGER("openstudio.model.LifeCycleCostParameters");
306
307 /// @endcond
308 };
309
310 /** \relates LifeCycleCostParameters */
311 using OptionalLifeCycleCostParameters = boost::optional<LifeCycleCostParameters>;
312
313 /** \relates LifeCycleCostParameters */
314 using LifeCycleCostParametersVector = std::vector<LifeCycleCostParameters>;
315
316 } // namespace model
317 } // namespace openstudio
318
319 #endif // MODEL_LIFECYCLECOSTPARAMETERS_HPP
320