GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 33.6% 414 / 0 / 1231
Functions: 45.0% 98 / 0 / 218
Branches: 28.0% 434 / 0 / 1551

src/model/SpaceType.cpp
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 #include "SpaceType.hpp"
7 #include "SpaceType_Impl.hpp"
8
9 #include "DefaultConstructionSet.hpp"
10 #include "DefaultConstructionSet_Impl.hpp"
11 #include "DefaultScheduleSet.hpp"
12 #include "DefaultScheduleSet_Impl.hpp"
13 #include "RenderingColor.hpp"
14 #include "RenderingColor_Impl.hpp"
15
16 #include "Space.hpp"
17 #include "Space_Impl.hpp"
18 #include "InternalMass.hpp"
19 #include "InternalMass_Impl.hpp"
20 #include "People.hpp"
21 #include "People_Impl.hpp"
22 #include "PeopleDefinition.hpp"
23 #include "PeopleDefinition_Impl.hpp"
24 #include "Lights.hpp"
25 #include "Lights_Impl.hpp"
26 #include "LightsDefinition.hpp"
27 #include "LightsDefinition_Impl.hpp"
28 #include "Luminaire.hpp"
29 #include "Luminaire_Impl.hpp"
30 #include "ElectricEquipment.hpp"
31 #include "ElectricEquipment_Impl.hpp"
32 #include "ElectricEquipmentDefinition.hpp"
33 #include "ElectricEquipmentDefinition_Impl.hpp"
34 #include "ElectricEquipmentITEAirCooled.hpp"
35 #include "ElectricEquipmentITEAirCooled_Impl.hpp"
36 #include "ElectricEquipmentITEAirCooledDefinition.hpp"
37 #include "ElectricEquipmentITEAirCooledDefinition_Impl.hpp"
38 #include "GasEquipment.hpp"
39 #include "GasEquipment_Impl.hpp"
40 #include "GasEquipmentDefinition.hpp"
41 #include "GasEquipmentDefinition_Impl.hpp"
42 #include "HotWaterEquipment.hpp"
43 #include "HotWaterEquipment_Impl.hpp"
44 #include "HotWaterEquipmentDefinition.hpp"
45 #include "HotWaterEquipmentDefinition_Impl.hpp"
46 #include "SteamEquipment.hpp"
47 #include "SteamEquipment_Impl.hpp"
48 #include "OtherEquipment.hpp"
49 #include "OtherEquipment_Impl.hpp"
50 #include "SpaceInfiltrationDesignFlowRate.hpp"
51 #include "SpaceInfiltrationDesignFlowRate_Impl.hpp"
52 #include "SpaceInfiltrationEffectiveLeakageArea.hpp"
53 #include "SpaceInfiltrationEffectiveLeakageArea_Impl.hpp"
54 #include "SpaceInfiltrationFlowCoefficient.hpp"
55 #include "SpaceInfiltrationFlowCoefficient_Impl.hpp"
56 #include "DesignSpecificationOutdoorAir.hpp"
57 #include "DesignSpecificationOutdoorAir_Impl.hpp"
58
59 #include "Model.hpp"
60 #include "Model_Impl.hpp"
61 #include "Building.hpp"
62 #include "Building_Impl.hpp"
63 #include "Schedule.hpp"
64 #include "Schedule_Impl.hpp"
65
66 #include <utilities/idd/IddFactory.hxx>
67
68 #include <utilities/idd/OS_SpaceType_FieldEnums.hxx>
69 #include <utilities/idd/IddEnums.hxx>
70
71 #include "../utilities/math/FloatCompare.hpp"
72
73 #include "../utilities/core/Assert.hpp"
74 #include "../utilities/core/ContainersMove.hpp"
75
76 #include <model/embedded_files.hxx>
77 #include "../utilities/filetypes/StandardsJSON.hpp"
78 #include "../utilities/core/Json.hpp"
79 #include <json/json.h>
80
81 namespace openstudio {
82 namespace model {
83
84 namespace detail {
85
86 1 Json::Value parseStandardsJSON() {
87 // Embedded file path
88
1/1
✓ Branch 1 taken 1 time.
1 std::string embedded_path = ":/Resources/standards/OpenStudio_Standards_space_types_merged.json";
89
1/1
✓ Branch 1 taken 1 time.
1 std::string fileContent = ::openstudiomodel::embedded_files::getFileAsString(embedded_path);
90
91 // Create a StandardsJSON
92
1/1
✓ Branch 1 taken 1 time.
1 StandardsJSON standard(fileContent);
93
94 // Now try to get the primaryKey
95
1/1
✓ Branch 1 taken 1 time.
1 std::string primaryKey = "space_types";
96
97
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<Json::Value> _standardsArr = standard.getPrimaryKey(primaryKey)) {
98
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return _standardsArr.get();
99 } else {
100 // This should never happen really, until we implement the ability to supply a custom StandardsJSON
101 ✗ LOG_FREE(Error, "SpaceType", "Cannot find the primaryKey '" << primaryKey << "' in the StandardsJSON");
102 ✗ return {};
103 1 }
104 1 }
105
106 19 const Json::Value& SpaceType_Impl::getStandardsJSON() {
107 // Relies on utilties/StandardsJSON since it's used in several places
108 // Here we store a Json::Value rather than the StandardsJSON because we only care about the "space_types" primaryKey
109 // Not the whole StandardsJSON
110
4/7
✓ Branch 0 taken 1 time.
✓ Branch 1 taken 18 times.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 time.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
19 static const Json::Value standardsArr{parseStandardsJSON()};
111 19 return standardsArr;
112 }
113
114 1519 SpaceType_Impl::SpaceType_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
115 1519 : ResourceObject_Impl(idfObject, model, keepHandle) {
116
4/6
✓ Branch 1 taken 1519 times.
✓ Branch 4 taken 1519 times.
✓ Branch 7 taken 1519 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 1519 times.
✗ Branch 13 not taken.
1519 OS_ASSERT(idfObject.iddObject().type() == SpaceType::iddObjectType());
117 1519 }
118
119 887 SpaceType_Impl::SpaceType_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
120 887 : ResourceObject_Impl(other, model, keepHandle) {
121
4/6
✓ Branch 1 taken 887 times.
✓ Branch 4 taken 887 times.
✓ Branch 7 taken 887 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 887 times.
✗ Branch 13 not taken.
887 OS_ASSERT(other.iddObject().type() == SpaceType::iddObjectType());
122 887 }
123
124 556 SpaceType_Impl::SpaceType_Impl(const SpaceType_Impl& other, Model_Impl* model, bool keepHandle) : ResourceObject_Impl(other, model, keepHandle) {}
125
126 1 const std::vector<std::string>& SpaceType_Impl::outputVariableNames() const {
127
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
1 static const std::vector<std::string> result;
128 1 return result;
129 }
130
131 22363 IddObjectType SpaceType_Impl::iddObjectType() const {
132 22363 return SpaceType::iddObjectType();
133 }
134
135 556 std::vector<ModelObject> SpaceType_Impl::children() const {
136
5/5
✓ Branch 1 taken 556 times.
✓ Branch 4 taken 556 times.
✓ Branch 7 taken 556 times.
✓ Branch 10 taken 556 times.
✓ Branch 13 taken 556 times.
1112 return concat<ModelObject>(this->internalMass(), this->people(), this->lights(), this->luminaires(), this->electricEquipment(),
137
4/4
✓ Branch 1 taken 556 times.
✓ Branch 4 taken 556 times.
✓ Branch 7 taken 556 times.
✓ Branch 10 taken 556 times.
1112 this->electricEquipmentITEAirCooled(), this->gasEquipment(), this->hotWaterEquipment(), this->steamEquipment(),
138
3/3
✓ Branch 1 taken 556 times.
✓ Branch 4 taken 556 times.
✓ Branch 7 taken 556 times.
1112 this->otherEquipment(), this->spaceInfiltrationDesignFlowRates(), this->spaceInfiltrationEffectiveLeakageAreas(),
139
2/2
✓ Branch 1 taken 556 times.
✓ Branch 4 taken 556 times.
1668 this->spaceInfiltrationFlowCoefficients());
140 }
141
142 1 boost::optional<std::string> SpaceType_Impl::setNameProtected(const std::string& newName) {
143 // don't allow user to change name of plenum space type since this is found by name in Model::plenumSpaceType
144
5/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 15 taken 1 time.
✗ Branch 16 not taken.
1 if (istringEqual(this->model().plenumSpaceTypeName(), this->nameString())) {
145
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return this->nameString();
146 }
147 ✗ return ResourceObject_Impl::setName(newName);
148 }
149
150 19610 boost::optional<DefaultConstructionSet> SpaceType_Impl::defaultConstructionSet() const {
151
2/2
✓ Branch 1 taken 19610 times.
✓ Branch 4 taken 19610 times.
19610 return getObject<ModelObject>().getModelObjectTarget<DefaultConstructionSet>(OS_SpaceTypeFields::DefaultConstructionSetName);
152 }
153
154 76 bool SpaceType_Impl::setDefaultConstructionSet(const DefaultConstructionSet& defaultConstructionSet) {
155
2/2
✓ Branch 1 taken 76 times.
✓ Branch 4 taken 76 times.
76 return setPointer(OS_SpaceTypeFields::DefaultConstructionSetName, defaultConstructionSet.handle());
156 }
157
158 85 void SpaceType_Impl::resetDefaultConstructionSet() {
159
2/2
✓ Branch 1 taken 85 times.
✓ Branch 4 taken 85 times.
170 setString(OS_SpaceTypeFields::DefaultConstructionSetName, "");
160 85 }
161
162 1078 boost::optional<DefaultScheduleSet> SpaceType_Impl::defaultScheduleSet() const {
163
2/2
✓ Branch 1 taken 1078 times.
✓ Branch 4 taken 1078 times.
1078 return getObject<ModelObject>().getModelObjectTarget<DefaultScheduleSet>(OS_SpaceTypeFields::DefaultScheduleSetName);
164 }
165
166 490 boost::optional<Schedule> SpaceType_Impl::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const {
167 490 boost::optional<Schedule> result;
168 490 boost::optional<DefaultScheduleSet> defaultScheduleSet;
169 490 boost::optional<Building> building;
170 490 boost::optional<SpaceType> spaceType;
171
172 // first check this object
173
1/1
✓ Branch 1 taken 490 times.
490 defaultScheduleSet = this->defaultScheduleSet();
174
2/2
✓ Branch 0 taken 221 times.
✓ Branch 1 taken 269 times.
490 if (defaultScheduleSet) {
175
2/2
✓ Branch 1 taken 221 times.
✓ Branch 4 taken 221 times.
221 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
176
2/2
✓ Branch 0 taken 220 times.
✓ Branch 1 taken 1 time.
221 if (result) {
177 220 return result;
178 }
179 }
180
181 // then check building
182
2/2
✓ Branch 1 taken 270 times.
✓ Branch 4 taken 270 times.
270 building = this->model().building();
183
2/2
✓ Branch 0 taken 265 times.
✓ Branch 1 taken 5 times.
270 if (building) {
184
2/2
✓ Branch 1 taken 265 times.
✓ Branch 4 taken 265 times.
265 defaultScheduleSet = building->defaultScheduleSet();
185
2/2
✓ Branch 0 taken 141 times.
✓ Branch 1 taken 124 times.
265 if (defaultScheduleSet) {
186
2/2
✓ Branch 1 taken 141 times.
✓ Branch 4 taken 141 times.
141 result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
187
1/2
✓ Branch 0 taken 141 times.
✗ Branch 1 not taken.
141 if (result) {
188 141 return result;
189 }
190 }
191
192 // then check building's space type
193
2/2
✓ Branch 1 taken 124 times.
✓ Branch 4 taken 124 times.
124 spaceType = building->spaceType();
194
2/2
✓ Branch 0 taken 73 times.
✓ Branch 1 taken 51 times.
124 if (spaceType) {
195
2/2
✓ Branch 1 taken 73 times.
✓ Branch 4 taken 73 times.
73 defaultScheduleSet = spaceType->defaultScheduleSet();
196
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 73 times.
73 if (defaultScheduleSet) {
197 ✗ result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType);
198 ✗ if (result) {
199 ✗ return result;
200 }
201 }
202 }
203 }
204
205 129 return boost::none;
206 490 }
207
208 5 bool SpaceType_Impl::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) {
209
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return setPointer(OS_SpaceTypeFields::DefaultScheduleSetName, defaultScheduleSet.handle());
210 }
211
212 85 void SpaceType_Impl::resetDefaultScheduleSet() {
213
2/2
✓ Branch 1 taken 85 times.
✓ Branch 4 taken 85 times.
170 setString(OS_SpaceTypeFields::DefaultScheduleSetName, "");
214 85 }
215
216 2332 boost::optional<RenderingColor> SpaceType_Impl::renderingColor() const {
217
2/2
✓ Branch 1 taken 2332 times.
✓ Branch 4 taken 2332 times.
2332 return getObject<ModelObject>().getModelObjectTarget<RenderingColor>(OS_SpaceTypeFields::GroupRenderingName);
218 }
219
220 205 bool SpaceType_Impl::setRenderingColor(const RenderingColor& renderingColor) {
221
2/2
✓ Branch 1 taken 205 times.
✓ Branch 4 taken 205 times.
205 return setPointer(OS_SpaceTypeFields::GroupRenderingName, renderingColor.handle());
222 }
223
224 85 void SpaceType_Impl::resetRenderingColor() {
225
2/2
✓ Branch 1 taken 85 times.
✓ Branch 4 taken 85 times.
170 setString(OS_SpaceTypeFields::GroupRenderingName, "");
226 85 }
227
228 23 boost::optional<std::string> SpaceType_Impl::standardsTemplate() const {
229 23 boost::optional<std::string> result;
230
3/3
✓ Branch 1 taken 23 times.
✓ Branch 3 taken 19 times.
✓ Branch 4 taken 4 times.
46 if (boost::optional<std::string> standardsTemplate = getString(OS_SpaceTypeFields::StandardsTemplate, false, true)) {
231
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 result = standardsTemplate.get();
232 } else {
233 // If not set, try to inherit from building
234
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boost::optional<Building> building = this->model().getOptionalUniqueModelObject<Building>();
235
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (building) {
236 ✗ result = building->standardsTemplate();
237 }
238 27 }
239 23 return result;
240 ✗ }
241
242 4 std::vector<std::string> SpaceType_Impl::suggestedStandardsTemplates() const {
243 // TODO: JM 2018-11-07 replace with a std::unordered_set?
244 4 std::vector<std::string> result;
245
246
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<std::string> standardsTemplate = this->standardsTemplate();
247
248 // Find the possible template names
249 // standardsJSON is an array of hashes (no nested levels)
250
8/8
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 20732 times.
✓ Branch 13 taken 20732 times.
✓ Branch 16 taken 20736 times.
✓ Branch 18 taken 20732 times.
✓ Branch 19 taken 4 times.
20736 for (const auto& v : getStandardsJSON()) {
251
2/2
✓ Branch 1 taken 20732 times.
✓ Branch 4 taken 20732 times.
20732 const Json::Value _template = v["template"];
252
2/3
✓ Branch 1 taken 20732 times.
✓ Branch 3 taken 20732 times.
✗ Branch 4 not taken.
20732 if (_template.isString()) {
253
2/2
✓ Branch 1 taken 20732 times.
✓ Branch 4 taken 20732 times.
20732 result.emplace_back(_template.asString());
254 }
255 20732 }
256
257 // include values from model
258
259
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boost::optional<Building> building = this->model().getOptionalUniqueModelObject<Building>();
260 4 boost::optional<std::string> buildingStandardsTemplate;
261
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (building) {
262 ✗ buildingStandardsTemplate = building->standardsTemplate();
263 }
264
265
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 12 taken 4 times.
✓ Branch 13 taken 4 times.
8 for (const SpaceType& other : this->model().getConcreteModelObjects<SpaceType>()) {
266
4/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 9 taken 4 times.
✗ Branch 10 not taken.
4 if (other.handle() == this->handle()) {
267 4 continue;
268 }
269 ✗ boost::optional<std::string> otherTemplate = other.standardsTemplate();
270 ✗ if (otherTemplate) {
271 ✗ result.emplace_back(*otherTemplate);
272 }
273 4 }
274
275 // remove buildingStandardsTemplate and standardsTemplate
276
1/1
✓ Branch 1 taken 4 times.
4 IstringFind finder;
277
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (buildingStandardsTemplate) {
278 ✗ finder.addTarget(*buildingStandardsTemplate);
279 }
280
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
4 if (standardsTemplate) {
281
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 finder.addTarget(*standardsTemplate);
282 }
283
2/2
✓ Branch 1 taken 4 times.
✓ Branch 6 taken 4 times.
4 auto it = std::remove_if(result.begin(), result.end(), finder);
284
1/1
✓ Branch 2 taken 4 times.
8 result.resize(std::distance(result.begin(), it));
285
286 // sort
287
1/1
✓ Branch 3 taken 4 times.
4 std::sort(result.begin(), result.end(), IstringCompare());
288
289 // make unique
290 // DLM: have to sort before calling unique, unique only works on consecutive elements
291
1/1
✓ Branch 3 taken 4 times.
4 it = std::unique(result.begin(), result.end(), IstringEqual());
292
1/1
✓ Branch 2 taken 4 times.
8 result.resize(std::distance(result.begin(), it));
293
294 // add building value to front
295
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (buildingStandardsTemplate) {
296 ✗ result.insert(result.begin(), *buildingStandardsTemplate);
297 }
298
299 // add current to front
300
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 time.
4 if (standardsTemplate) {
301
2/2
✓ Branch 1 taken 3 times.
✓ Branch 6 taken 3 times.
3 result.insert(result.begin(), *standardsTemplate);
302 }
303
304 8 return result;
305 4 }
306
307 3 bool SpaceType_Impl::setStandardsTemplate(const std::string& standardsTemplate) {
308 3 bool test = setString(OS_SpaceTypeFields::StandardsTemplate, standardsTemplate);
309
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 OS_ASSERT(test);
310 3 return test;
311 }
312
313 ✗ void SpaceType_Impl::resetStandardsTemplate() {
314 ✗ bool test = setString(OS_SpaceTypeFields::StandardsTemplate, "");
315 ✗ OS_ASSERT(test);
316 ✗ }
317
318 /** STANDARDS BUILDING TYPE */
319 37 boost::optional<std::string> SpaceType_Impl::standardsBuildingType() const {
320 37 boost::optional<std::string> result;
321
3/3
✓ Branch 1 taken 37 times.
✓ Branch 3 taken 20 times.
✓ Branch 4 taken 17 times.
74 if (boost::optional<std::string> standardsBuildingType = getString(OS_SpaceTypeFields::StandardsBuildingType, false, true)) {
322
2/2
✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
20 result = standardsBuildingType.get();
323 } else {
324 // If not set, try to inherit from building
325
2/2
✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
17 boost::optional<Building> building = this->model().getOptionalUniqueModelObject<Building>();
326
2/2
✓ Branch 0 taken 11 times.
✓ Branch 1 taken 6 times.
17 if (building) {
327
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 result = building->standardsBuildingType();
328 }
329 54 }
330
331 37 return result;
332 ✗ }
333
334 8 std::vector<std::string> SpaceType_Impl::suggestedStandardsBuildingTypes() const {
335 8 std::vector<std::string> result;
336
337
1/1
✓ Branch 1 taken 8 times.
8 const boost::optional<std::string> standardsTemplate = this->standardsTemplate();
338
1/1
✓ Branch 1 taken 8 times.
8 const boost::optional<std::string> standardsBuildingType = this->standardsBuildingType();
339
340 // include values from json if template is already set
341
2/2
✓ Branch 0 taken 7 times.
✓ Branch 1 taken 1 time.
8 if (standardsTemplate) {
342 // Find the possible building_type names that have the template name
343 // standardsJSON is an array of hashes (no nested levels)
344
8/8
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 36281 times.
✓ Branch 13 taken 36281 times.
✓ Branch 16 taken 36288 times.
✓ Branch 18 taken 36281 times.
✓ Branch 19 taken 7 times.
36288 for (const auto& v : getStandardsJSON()) {
345
2/2
✓ Branch 1 taken 36281 times.
✓ Branch 4 taken 36281 times.
36281 const auto thisTemplate = v["template"].asString();
346
3/3
✓ Branch 1 taken 36281 times.
✓ Branch 4 taken 1855 times.
✓ Branch 5 taken 34426 times.
36281 if (thisTemplate == standardsTemplate.get()) {
347
2/2
✓ Branch 1 taken 1855 times.
✓ Branch 4 taken 1855 times.
1855 const Json::Value _buildingType = v["building_type"];
348
2/3
✓ Branch 1 taken 1855 times.
✓ Branch 3 taken 1855 times.
✗ Branch 4 not taken.
1855 if (_buildingType.isString()) {
349
2/2
✓ Branch 1 taken 1855 times.
✓ Branch 4 taken 1855 times.
1855 result.emplace_back(_buildingType.asString());
350 }
351 1855 }
352 36281 }
353 }
354
355 // include values from model
356
357
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 boost::optional<Building> building = this->model().getOptionalUniqueModelObject<Building>();
358 8 boost::optional<std::string> buildingStandardsBuildingType;
359
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 if (building) {
360 ✗ buildingStandardsBuildingType = building->standardsBuildingType();
361 }
362
363
4/4
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 12 taken 8 times.
✓ Branch 13 taken 8 times.
16 for (const SpaceType& other : this->model().getConcreteModelObjects<SpaceType>()) {
364
4/5
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 9 taken 8 times.
✗ Branch 10 not taken.
8 if (other.handle() == this->handle()) {
365 8 continue;
366 }
367 ✗ boost::optional<std::string> otherBuildingType = other.standardsBuildingType();
368 ✗ if (otherBuildingType) {
369 ✗ result.emplace_back(*otherBuildingType);
370 }
371 8 }
372
373 // remove buildingStandardsBuildingType and standardsBuildingType
374
1/1
✓ Branch 1 taken 8 times.
8 IstringFind finder;
375
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 if (buildingStandardsBuildingType) {
376 ✗ finder.addTarget(*buildingStandardsBuildingType);
377 }
378
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 2 times.
8 if (standardsBuildingType) {
379
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 finder.addTarget(*standardsBuildingType);
380 }
381
2/2
✓ Branch 1 taken 8 times.
✓ Branch 6 taken 8 times.
8 auto it = std::remove_if(result.begin(), result.end(), finder);
382
1/1
✓ Branch 2 taken 8 times.
16 result.resize(std::distance(result.begin(), it));
383
384 // sort
385
1/1
✓ Branch 3 taken 8 times.
8 std::sort(result.begin(), result.end(), IstringCompare());
386
387 // make unique
388 // DLM: have to sort before calling unique, unique only works on consecutive elements
389
1/1
✓ Branch 3 taken 8 times.
8 it = std::unique(result.begin(), result.end(), IstringEqual());
390
1/1
✓ Branch 2 taken 8 times.
16 result.resize(std::distance(result.begin(), it));
391
392 // add building value to front
393
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 if (buildingStandardsBuildingType) {
394 ✗ result.insert(result.begin(), *buildingStandardsBuildingType);
395 }
396
397 // add current to front
398
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 2 times.
8 if (standardsBuildingType) {
399
2/2
✓ Branch 1 taken 6 times.
✓ Branch 6 taken 6 times.
6 result.insert(result.begin(), *standardsBuildingType);
400 }
401
402 16 return result;
403 8 }
404
405 3 bool SpaceType_Impl::setStandardsBuildingType(const std::string& standardsBuildingType) {
406 3 bool test = setString(OS_SpaceTypeFields::StandardsBuildingType, standardsBuildingType);
407
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 OS_ASSERT(test);
408 3 return test;
409 }
410
411 ✗ void SpaceType_Impl::resetStandardsBuildingType() {
412 ✗ bool test = setString(OS_SpaceTypeFields::StandardsBuildingType, "");
413 ✗ OS_ASSERT(test);
414 ✗ }
415
416 /** STANDARDS SPACE TYPE */
417 31 boost::optional<std::string> SpaceType_Impl::standardsSpaceType() const {
418 31 return getString(OS_SpaceTypeFields::StandardsSpaceType, false, true);
419 }
420
421 10 std::vector<std::string> SpaceType_Impl::suggestedStandardsSpaceTypes() const {
422 10 std::vector<std::string> result;
423
424
1/1
✓ Branch 1 taken 10 times.
10 boost::optional<std::string> standardsTemplate = this->standardsTemplate();
425
1/1
✓ Branch 1 taken 10 times.
10 boost::optional<std::string> standardsBuildingType = this->standardsBuildingType();
426
1/1
✓ Branch 1 taken 10 times.
10 boost::optional<std::string> standardsSpaceType = this->standardsSpaceType();
427
428 // include values from json if template and building_type are set
429
6/6
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1 time.
✓ Branch 2 taken 8 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 2 times.
19 if (standardsTemplate && standardsBuildingType) {
430 // Find the possible space_type names that have the right template and building_type name
431 // standardsJSON is an array of hashes (no nested levels)
432
8/8
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 41464 times.
✓ Branch 13 taken 41464 times.
✓ Branch 16 taken 41472 times.
✓ Branch 18 taken 41464 times.
✓ Branch 19 taken 8 times.
41472 for (const auto& v : getStandardsJSON()) {
433
2/2
✓ Branch 1 taken 41464 times.
✓ Branch 4 taken 41464 times.
41464 auto thisTemplate = v["template"].asString();
434
2/2
✓ Branch 1 taken 41464 times.
✓ Branch 4 taken 41464 times.
41464 auto thisBuildingType = v["building_type"].asString();
435
8/8
✓ Branch 1 taken 41464 times.
✓ Branch 4 taken 2120 times.
✓ Branch 5 taken 39344 times.
✓ Branch 7 taken 2120 times.
✓ Branch 10 taken 126 times.
✓ Branch 11 taken 1994 times.
✓ Branch 12 taken 126 times.
✓ Branch 13 taken 41338 times.
41464 if ((thisTemplate == standardsTemplate.get()) && (thisBuildingType == standardsBuildingType.get())) {
436
2/2
✓ Branch 1 taken 126 times.
✓ Branch 4 taken 126 times.
126 const Json::Value _spaceType = v["space_type"];
437
2/3
✓ Branch 1 taken 126 times.
✓ Branch 3 taken 126 times.
✗ Branch 4 not taken.
126 if (_spaceType.isString()) {
438
2/2
✓ Branch 1 taken 126 times.
✓ Branch 4 taken 126 times.
126 result.emplace_back(_spaceType.asString());
439 }
440 126 }
441 41464 }
442 }
443
444 // always add these hard coded types
445
1/1
✓ Branch 1 taken 10 times.
10 result.emplace_back("Attic");
446
1/1
✓ Branch 1 taken 10 times.
10 result.emplace_back("Plenum");
447
448 // include values from model
449
4/4
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 12 taken 10 times.
✓ Branch 13 taken 10 times.
20 for (const SpaceType& other : this->model().getConcreteModelObjects<SpaceType>()) {
450
4/5
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✓ Branch 9 taken 10 times.
✗ Branch 10 not taken.
10 if (other.handle() == this->handle()) {
451 10 continue;
452 }
453
454 ✗ boost::optional<std::string> otherBuildingType = other.standardsBuildingType();
455 ✗ if (standardsBuildingType && otherBuildingType) {
456 // need to be the same
457 ✗ if (standardsBuildingType.get() != otherBuildingType.get()) {
458 ✗ continue;
459 }
460 ✗ } else if (!standardsBuildingType && !otherBuildingType) {
461 // both empty
462 } else {
463 // different
464 ✗ continue;
465 }
466
467 ✗ boost::optional<std::string> otherSpaceType = other.standardsSpaceType();
468 ✗ if (otherSpaceType) {
469 ✗ result.emplace_back(*otherSpaceType);
470 }
471 10 }
472
473 // remove buildingStandardsBuildingType and standardsBuildingType
474
1/1
✓ Branch 1 taken 10 times.
10 IstringFind finder;
475
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 7 times.
10 if (standardsSpaceType) {
476
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 finder.addTarget(*standardsSpaceType);
477 }
478
2/2
✓ Branch 1 taken 10 times.
✓ Branch 6 taken 10 times.
10 auto it = std::remove_if(result.begin(), result.end(), finder);
479
1/1
✓ Branch 2 taken 10 times.
20 result.resize(std::distance(result.begin(), it));
480
481 // sort
482
1/1
✓ Branch 3 taken 10 times.
10 std::sort(result.begin(), result.end(), IstringCompare());
483
484 // make unique
485 // DLM: have to sort before calling unique, unique only works on consecutive elements
486
1/1
✓ Branch 3 taken 10 times.
10 it = std::unique(result.begin(), result.end(), IstringEqual());
487
1/1
✓ Branch 2 taken 10 times.
20 result.resize(std::distance(result.begin(), it));
488
489 // add current to front
490
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 7 times.
10 if (standardsSpaceType) {
491
2/2
✓ Branch 1 taken 3 times.
✓ Branch 6 taken 3 times.
3 result.insert(result.begin(), *standardsSpaceType);
492 }
493
494 20 return result;
495 10 }
496
497 3 bool SpaceType_Impl::setStandardsSpaceType(const std::string& standardsSpaceType) {
498 3 bool test = setString(OS_SpaceTypeFields::StandardsSpaceType, standardsSpaceType);
499
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 OS_ASSERT(test);
500 3 return test;
501 }
502
503 ✗ void SpaceType_Impl::resetStandardsSpaceType() {
504 ✗ bool test = setString(OS_SpaceTypeFields::StandardsSpaceType, "");
505 ✗ OS_ASSERT(test);
506 ✗ }
507
508 542 std::vector<Space> SpaceType_Impl::spaces() const {
509 542 std::vector<Space> result;
510
511
1/1
✓ Branch 1 taken 542 times.
542 Handle handle = this->handle();
512
4/4
✓ Branch 1 taken 542 times.
✓ Branch 4 taken 542 times.
✓ Branch 12 taken 2023 times.
✓ Branch 13 taken 542 times.
2565 for (Space& space : this->model().getConcreteModelObjects<Space>()) {
513
1/1
✓ Branch 1 taken 2023 times.
2023 OptionalSpaceType spaceType = space.spaceType();
514
2/2
✓ Branch 0 taken 1982 times.
✓ Branch 1 taken 41 times.
2023 if (spaceType) {
515
5/5
✓ Branch 1 taken 1982 times.
✓ Branch 4 taken 1982 times.
✓ Branch 7 taken 1982 times.
✓ Branch 9 taken 781 times.
✓ Branch 10 taken 1201 times.
1982 if (spaceType->handle() == handle) {
516
1/1
✓ Branch 2 taken 781 times.
781 result.emplace_back(std::move(space));
517 }
518 }
519 2565 }
520
521 1084 return result;
522 ✗ }
523
524 730 InternalMassVector SpaceType_Impl::internalMass() const {
525
3/3
✓ Branch 1 taken 730 times.
✓ Branch 4 taken 730 times.
✓ Branch 7 taken 730 times.
730 return getObject<ModelObject>().getModelObjectSources<InternalMass>(InternalMass::iddObjectType());
526 }
527
528 1467 PeopleVector SpaceType_Impl::people() const {
529
3/3
✓ Branch 1 taken 1467 times.
✓ Branch 4 taken 1467 times.
✓ Branch 7 taken 1467 times.
1467 return getObject<ModelObject>().getModelObjectSources<People>(People::iddObjectType());
530 }
531
532 942 LightsVector SpaceType_Impl::lights() const {
533
3/3
✓ Branch 1 taken 942 times.
✓ Branch 4 taken 942 times.
✓ Branch 7 taken 942 times.
942 return getObject<ModelObject>().getModelObjectSources<Lights>(Lights::iddObjectType());
534 }
535
536 917 LuminaireVector SpaceType_Impl::luminaires() const {
537
3/3
✓ Branch 1 taken 917 times.
✓ Branch 4 taken 917 times.
✓ Branch 7 taken 917 times.
917 return getObject<ModelObject>().getModelObjectSources<Luminaire>(Luminaire::iddObjectType());
538 }
539
540 858 ElectricEquipmentVector SpaceType_Impl::electricEquipment() const {
541
3/3
✓ Branch 1 taken 858 times.
✓ Branch 4 taken 858 times.
✓ Branch 7 taken 858 times.
858 return getObject<ModelObject>().getModelObjectSources<ElectricEquipment>(ElectricEquipment::iddObjectType());
542 }
543
544 895 ElectricEquipmentITEAirCooledVector SpaceType_Impl::electricEquipmentITEAirCooled() const {
545
3/3
✓ Branch 1 taken 895 times.
✓ Branch 4 taken 895 times.
✓ Branch 7 taken 895 times.
895 return getObject<ModelObject>().getModelObjectSources<ElectricEquipmentITEAirCooled>(ElectricEquipmentITEAirCooled::iddObjectType());
546 }
547
548 767 GasEquipmentVector SpaceType_Impl::gasEquipment() const {
549
3/3
✓ Branch 1 taken 767 times.
✓ Branch 4 taken 767 times.
✓ Branch 7 taken 767 times.
767 return getObject<ModelObject>().getModelObjectSources<GasEquipment>(GasEquipment::iddObjectType());
550 }
551
552 766 HotWaterEquipmentVector SpaceType_Impl::hotWaterEquipment() const {
553
3/3
✓ Branch 1 taken 766 times.
✓ Branch 4 taken 766 times.
✓ Branch 7 taken 766 times.
766 return getObject<ModelObject>().getModelObjectSources<HotWaterEquipment>(HotWaterEquipment::iddObjectType());
554 }
555
556 730 SteamEquipmentVector SpaceType_Impl::steamEquipment() const {
557
3/3
✓ Branch 1 taken 730 times.
✓ Branch 4 taken 730 times.
✓ Branch 7 taken 730 times.
730 return getObject<ModelObject>().getModelObjectSources<SteamEquipment>(SteamEquipment::iddObjectType());
558 }
559
560 730 OtherEquipmentVector SpaceType_Impl::otherEquipment() const {
561
3/3
✓ Branch 1 taken 730 times.
✓ Branch 4 taken 730 times.
✓ Branch 7 taken 730 times.
730 return getObject<ModelObject>().getModelObjectSources<OtherEquipment>(OtherEquipment::iddObjectType());
562 }
563
564 587 SpaceInfiltrationDesignFlowRateVector SpaceType_Impl::spaceInfiltrationDesignFlowRates() const {
565
3/3
✓ Branch 1 taken 587 times.
✓ Branch 4 taken 587 times.
✓ Branch 7 taken 587 times.
587 return getObject<ModelObject>().getModelObjectSources<SpaceInfiltrationDesignFlowRate>(SpaceInfiltrationDesignFlowRate::iddObjectType());
566 }
567
568 713 SpaceInfiltrationEffectiveLeakageAreaVector SpaceType_Impl::spaceInfiltrationEffectiveLeakageAreas() const {
569
1/1
✓ Branch 1 taken 713 times.
1426 return getObject<ModelObject>().getModelObjectSources<SpaceInfiltrationEffectiveLeakageArea>(
570
2/2
✓ Branch 1 taken 713 times.
✓ Branch 4 taken 713 times.
1426 SpaceInfiltrationEffectiveLeakageArea::iddObjectType());
571 }
572
573 716 SpaceInfiltrationFlowCoefficientVector SpaceType_Impl::spaceInfiltrationFlowCoefficients() const {
574
3/3
✓ Branch 1 taken 716 times.
✓ Branch 4 taken 716 times.
✓ Branch 7 taken 716 times.
716 return getObject<ModelObject>().getModelObjectSources<SpaceInfiltrationFlowCoefficient>(SpaceInfiltrationFlowCoefficient::iddObjectType());
575 }
576
577 554 boost::optional<DesignSpecificationOutdoorAir> SpaceType_Impl::designSpecificationOutdoorAir() const {
578
1/1
✓ Branch 1 taken 554 times.
1108 return getObject<ModelObject>().getModelObjectTarget<DesignSpecificationOutdoorAir>(
579
1/1
✓ Branch 1 taken 554 times.
1108 OS_SpaceTypeFields::DesignSpecificationOutdoorAirObjectName);
580 }
581
582 ✗ bool SpaceType_Impl::isDesignSpecificationOutdoorAirDefaulted() const {
583 ✗ return isEmpty(OS_SpaceTypeFields::DesignSpecificationOutdoorAirObjectName);
584 }
585
586 5 bool SpaceType_Impl::setDesignSpecificationOutdoorAir(const DesignSpecificationOutdoorAir& designSpecificationOutdoorAir) {
587
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return setPointer(OS_SpaceTypeFields::DesignSpecificationOutdoorAirObjectName, designSpecificationOutdoorAir.handle());
588 }
589
590 ✗ void SpaceType_Impl::resetDesignSpecificationOutdoorAir() {
591 ✗ bool test = setString(OS_SpaceTypeFields::DesignSpecificationOutdoorAirObjectName, "");
592 ✗ OS_ASSERT(test);
593 ✗ }
594
595 58 void SpaceType_Impl::hardApplySpaceLoadSchedules() {
596
3/3
✓ Branch 1 taken 58 times.
✓ Branch 8 taken 53 times.
✓ Branch 9 taken 58 times.
111 for (const ModelObject& child : this->children()) {
597
2/3
✓ Branch 1 taken 53 times.
✓ Branch 3 taken 53 times.
✗ Branch 4 not taken.
106 if (auto load_ = child.optionalCast<SpaceLoad>()) {
598
2/2
✓ Branch 1 taken 53 times.
✓ Branch 4 taken 53 times.
53 load_->hardApplySchedules();
599 53 }
600 58 }
601 58 }
602
603 ✗ boost::optional<double> SpaceType_Impl::peoplePerFloorArea() const {
604 ✗ double result(0.0);
605 ✗ for (const People& peopleObject : people()) {
606 ✗ OptionalDouble temp = peopleObject.peoplePerFloorArea();
607 ✗ if (temp) {
608 ✗ result += temp.get();
609 } else {
610 ✗ return boost::none;
611 }
612 ✗ }
613 ✗ return result;
614 }
615
616 ✗ bool SpaceType_Impl::setPeoplePerFloorArea(boost::optional<double> peoplePerFloorArea) {
617 ✗ if (!peoplePerFloorArea) {
618 ✗ return false;
619 }
620 ✗ OptionalPeople templatePeople;
621 ✗ PeopleVector myPeople = people();
622 ✗ if (!myPeople.empty()) {
623 ✗ templatePeople = myPeople[0];
624 }
625 ✗ return setPeoplePerFloorArea(*peoplePerFloorArea, templatePeople);
626 ✗ }
627
628 ✗ bool SpaceType_Impl::setPeoplePerFloorArea(double peoplePerFloorArea, const boost::optional<People>& templatePeople) {
629 ✗ if (peoplePerFloorArea < 0.0) {
630 ✗ LOG(Error, "SpaceType cannot set peoplePerFloorArea to " << peoplePerFloorArea << ", the value must be >= 0.0.");
631 ✗ return false;
632 }
633
634 // create or modify People and PeopleDefinition object
635 ✗ OptionalPeople myPeople = getMySpaceLoadInstance<People, PeopleDefinition>(templatePeople);
636 ✗ if (!myPeople) {
637 ✗ LOG(Error, "The templatePeople object must be in the same Model as this SpaceType.");
638 ✗ return false;
639 }
640
641 // set space type and people perSpaceFloorArea
642 ✗ bool ok(true);
643 ✗ OS_ASSERT(myPeople);
644 ✗ myPeople->makeUnique();
645 ✗ ok = myPeople->setSpaceType(getObject<SpaceType>());
646 ✗ OS_ASSERT(ok);
647 ✗ ok = myPeople->peopleDefinition().setPeopleperSpaceFloorArea(peoplePerFloorArea);
648 ✗ OS_ASSERT(ok);
649 ✗ ok = myPeople->setMultiplier(1);
650 ✗ OS_ASSERT(ok);
651
652 // remove all other people
653 ✗ PeopleVector allMyPeople = people();
654 ✗ removeAllButOneSpaceLoadInstance<People>(allMyPeople, *myPeople);
655
656 ✗ return true;
657 ✗ }
658
659 ✗ boost::optional<double> SpaceType_Impl::spaceFloorAreaPerPerson() const {
660 ✗ OptionalDouble peoplePerArea = peoplePerFloorArea();
661 ✗ if (peoplePerArea) {
662 ✗ return 1.0 / peoplePerArea.get();
663 }
664 ✗ return boost::none;
665 }
666
667 ✗ bool SpaceType_Impl::setSpaceFloorAreaPerPerson(boost::optional<double> spaceFloorAreaPerPerson) {
668 ✗ if (!spaceFloorAreaPerPerson) {
669 ✗ return false;
670 }
671 ✗ OptionalPeople templatePeople;
672 ✗ PeopleVector myPeople = people();
673 ✗ if (!myPeople.empty()) {
674 ✗ templatePeople = myPeople[0];
675 }
676 ✗ return setSpaceFloorAreaPerPerson(*spaceFloorAreaPerPerson, templatePeople);
677 ✗ }
678
679 ✗ bool SpaceType_Impl::setSpaceFloorAreaPerPerson(double spaceFloorAreaPerPerson, const boost::optional<People>& templatePeople) {
680 ✗ if (lessThanOrEqual(spaceFloorAreaPerPerson, 0.0)) {
681 ✗ LOG(Error, "SpaceType cannot set spaceFloorAreaPerPerson to " << spaceFloorAreaPerPerson << ", the value must be > 0.0.");
682 ✗ return false;
683 }
684
685 // create or modify People and PeopleDefinition object
686 ✗ OptionalPeople myPeople = getMySpaceLoadInstance<People, PeopleDefinition>(templatePeople);
687 ✗ if (!myPeople) {
688 ✗ LOG(Error, "The templatePeople object must be in the same Model as this SpaceType.");
689 ✗ return false;
690 }
691
692 // set space type and people perSpaceFloorArea
693 ✗ bool ok(true);
694 ✗ OS_ASSERT(myPeople);
695 ✗ myPeople->makeUnique();
696 ✗ ok = myPeople->setSpaceType(getObject<SpaceType>());
697 ✗ OS_ASSERT(ok);
698 ✗ ok = myPeople->peopleDefinition().setSpaceFloorAreaperPerson(spaceFloorAreaPerPerson);
699 ✗ OS_ASSERT(ok);
700 ✗ ok = myPeople->setMultiplier(1);
701 ✗ OS_ASSERT(ok);
702
703 // remove all other people
704 ✗ PeopleVector allMyPeople = people();
705 ✗ removeAllButOneSpaceLoadInstance<People>(allMyPeople, *myPeople);
706
707 ✗ return true;
708 ✗ }
709
710 1 double SpaceType_Impl::getNumberOfPeople(double floorArea) const {
711 1 double result(0.0);
712
3/3
✓ Branch 1 taken 1 time.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 1 time.
4 for (const People& peopleObject : people()) {
713
1/1
✓ Branch 1 taken 3 times.
3 result += peopleObject.getNumberOfPeople(floorArea);
714 1 }
715 1 return result;
716 }
717
718 2 double SpaceType_Impl::getPeoplePerFloorArea(double floorArea) const {
719 2 double result(0.0);
720
3/3
✓ Branch 1 taken 2 times.
✓ Branch 7 taken 6 times.
✓ Branch 8 taken 2 times.
8 for (const People& peopleObject : people()) {
721
1/1
✓ Branch 1 taken 6 times.
6 result += peopleObject.getPeoplePerFloorArea(floorArea);
722 2 }
723 2 return result;
724 }
725
726 1 double SpaceType_Impl::getFloorAreaPerPerson(double floorArea) const {
727 1 return 1.0 / getPeoplePerFloorArea(floorArea);
728 }
729
730 ✗ boost::optional<double> SpaceType_Impl::lightingPowerPerFloorArea() const {
731 ✗ if (!luminaires().empty()) {
732 ✗ return boost::none;
733 }
734
735 ✗ double result(0.0);
736 ✗ for (const Lights& lightsObject : lights()) {
737 ✗ OptionalDouble temp = lightsObject.powerPerFloorArea();
738 ✗ if (temp) {
739 ✗ result += temp.get();
740 } else {
741 ✗ return boost::none;
742 }
743 ✗ }
744 ✗ return result;
745 }
746
747 19 bool SpaceType_Impl::setLightingPowerPerFloorArea(boost::optional<double> lightingPowerPerFloorArea) {
748
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19 times.
19 if (!lightingPowerPerFloorArea) {
749 ✗ return false;
750 }
751 19 OptionalLights templateLights;
752
1/1
✓ Branch 1 taken 19 times.
19 LightsVector myLights = lights();
753
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19 times.
19 if (!myLights.empty()) {
754 ✗ templateLights = myLights[0];
755 }
756
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 return setLightingPowerPerFloorArea(*lightingPowerPerFloorArea, templateLights);
757 19 }
758
759 19 bool SpaceType_Impl::setLightingPowerPerFloorArea(double lightingPowerPerFloorArea, const boost::optional<Lights>& templateLights) {
760
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
19 if (lightingPowerPerFloorArea < 0.0) {
761 ✗ LOG(Error, "SpaceType cannot set lightingPowerPerFloorArea to " << lightingPowerPerFloorArea << ", the value must be >= 0.0.");
762 ✗ return false;
763 }
764
765 // create or modify People and PeopleDefinition object
766
1/1
✓ Branch 1 taken 19 times.
19 OptionalLights myLights = getMySpaceLoadInstance<Lights, LightsDefinition>(templateLights);
767
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 19 times.
19 if (!myLights) {
768 ✗ LOG(Error, "The templateLights object must be in the same Model as this SpaceType.");
769 ✗ return false;
770 }
771
772 // set space type and lighting power per space floor area
773 19 bool ok(true);
774
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 19 times.
✗ Branch 4 not taken.
19 OS_ASSERT(myLights);
775
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 myLights->makeUnique();
776
3/3
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
✓ Branch 7 taken 19 times.
19 ok = myLights->setSpaceType(getObject<SpaceType>());
777
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
✗ Branch 3 not taken.
19 OS_ASSERT(ok);
778
3/3
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
✓ Branch 7 taken 19 times.
19 ok = myLights->lightsDefinition().setWattsperSpaceFloorArea(lightingPowerPerFloorArea);
779
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
✗ Branch 3 not taken.
19 OS_ASSERT(ok);
780
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 ok = myLights->setMultiplier(1);
781
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
✗ Branch 3 not taken.
19 OS_ASSERT(ok);
782
783 // remove all other lights
784
1/1
✓ Branch 1 taken 19 times.
19 LightsVector allMyLights = lights();
785
2/2
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
19 removeAllButOneSpaceLoadInstance<Lights>(allMyLights, *myLights);
786
787 // remove all luminaires
788
1/1
✓ Branch 1 taken 19 times.
19 LuminaireVector myLuminaires = luminaires();
789
1/2
✗ Branch 4 not taken.
✓ Branch 5 taken 19 times.
19 for (Luminaire& luminaire : myLuminaires) {
790 ✗ luminaire.remove();
791 }
792
793 19 return true;
794 19 }
795
796 ✗ boost::optional<double> SpaceType_Impl::lightingPowerPerPerson() const {
797 ✗ if (!luminaires().empty()) {
798 ✗ return boost::none;
799 }
800
801 ✗ double result(0.0);
802 ✗ for (const Lights& lightsObject : lights()) {
803 ✗ OptionalDouble temp = lightsObject.powerPerPerson();
804 ✗ if (temp) {
805 ✗ result += temp.get();
806 } else {
807 ✗ return boost::none;
808 }
809 ✗ }
810 ✗ return result;
811 }
812
813 ✗ bool SpaceType_Impl::setLightingPowerPerPerson(boost::optional<double> lightingPowerPerPerson) {
814 ✗ if (!lightingPowerPerPerson) {
815 ✗ return false;
816 }
817 ✗ OptionalLights templateLights;
818 ✗ LightsVector myLights = lights();
819 ✗ if (!myLights.empty()) {
820 ✗ templateLights = myLights[0];
821 }
822 ✗ return setLightingPowerPerPerson(*lightingPowerPerPerson, templateLights);
823 ✗ }
824
825 ✗ bool SpaceType_Impl::setLightingPowerPerPerson(double lightingPowerPerPerson, const boost::optional<Lights>& templateLights) {
826 ✗ if (lightingPowerPerPerson < 0.0) {
827 ✗ LOG(Error, "SpaceType cannot set lightingPowerPerPerson to " << lightingPowerPerPerson << ", the value must be >= 0.0.");
828 ✗ return false;
829 }
830
831 // create or modify People and PeopleDefinition object
832 ✗ OptionalLights myLights = getMySpaceLoadInstance<Lights, LightsDefinition>(templateLights);
833 ✗ if (!myLights) {
834 ✗ LOG(Error, "The templateLights object must be in the same Model as this SpaceType.");
835 ✗ return false;
836 }
837
838 // set space type and lighting power per person
839 ✗ bool ok(true);
840 ✗ OS_ASSERT(myLights);
841 ✗ myLights->makeUnique();
842 ✗ ok = myLights->setSpaceType(getObject<SpaceType>());
843 ✗ OS_ASSERT(ok);
844 ✗ ok = myLights->lightsDefinition().setWattsperPerson(lightingPowerPerPerson);
845 ✗ OS_ASSERT(ok);
846 ✗ ok = myLights->setMultiplier(1);
847 ✗ OS_ASSERT(ok);
848
849 // remove all other lights
850 ✗ LightsVector allMyLights = lights();
851 ✗ removeAllButOneSpaceLoadInstance<Lights>(allMyLights, *myLights);
852
853 // remove all luminaires
854 ✗ LuminaireVector myLuminaires = luminaires();
855 ✗ for (Luminaire& luminaire : myLuminaires) {
856 ✗ luminaire.remove();
857 }
858
859 ✗ return true;
860 ✗ }
861
862 ✗ double SpaceType_Impl::getLightingPower(double floorArea, double numPeople) const {
863 ✗ double result(0.0);
864 ✗ for (const Lights& lightsObject : lights()) {
865 ✗ result += lightsObject.getLightingPower(floorArea, numPeople);
866 ✗ }
867 ✗ for (const Luminaire& luminaire : luminaires()) {
868 ✗ result += luminaire.lightingPower();
869 ✗ }
870 ✗ return result;
871 }
872
873 ✗ double SpaceType_Impl::getLightingPowerPerFloorArea(double floorArea, double numPeople) const {
874 ✗ double result(0.0);
875 ✗ for (const Lights& lightsObject : lights()) {
876 ✗ result += lightsObject.getPowerPerFloorArea(floorArea, numPeople);
877 ✗ }
878 ✗ for (const Luminaire& luminaire : luminaires()) {
879 ✗ result += luminaire.getPowerPerFloorArea(floorArea);
880 ✗ }
881 ✗ return result;
882 }
883
884 ✗ double SpaceType_Impl::getLightingPowerPerPerson(double floorArea, double numPeople) const {
885 ✗ double result(0.0);
886 ✗ for (const Lights& lightsObject : lights()) {
887 ✗ result += lightsObject.getPowerPerPerson(floorArea, numPeople);
888 ✗ }
889 ✗ for (const Luminaire& luminaire : luminaires()) {
890 ✗ result += luminaire.getPowerPerPerson(numPeople);
891 ✗ }
892 ✗ return result;
893 }
894
895 ✗ boost::optional<double> SpaceType_Impl::electricEquipmentPowerPerFloorArea() const {
896 ✗ double result(0.0);
897 ✗ for (const ElectricEquipment& equipment : electricEquipment()) {
898 ✗ OptionalDouble temp = equipment.powerPerFloorArea();
899 ✗ if (temp) {
900 ✗ result += temp.get();
901 } else {
902 ✗ return boost::none;
903 }
904 ✗ }
905 ✗ return result;
906 }
907
908 ✗ boost::optional<double> SpaceType_Impl::electricEquipmentITEAirCooledPowerPerFloorArea() const {
909 ✗ double result(0.0);
910 ✗ for (const ElectricEquipmentITEAirCooled& iTequipment : electricEquipmentITEAirCooled()) {
911 ✗ OptionalDouble temp = iTequipment.powerPerFloorArea();
912 ✗ if (temp) {
913 ✗ result += temp.get();
914 } else {
915 ✗ return boost::none;
916 }
917 ✗ }
918 ✗ return result;
919 }
920
921 ✗ bool SpaceType_Impl::setElectricEquipmentPowerPerFloorArea(boost::optional<double> electricEquipmentPowerPerFloorArea) {
922 ✗ if (!electricEquipmentPowerPerFloorArea) {
923 ✗ return false;
924 }
925 ✗ OptionalElectricEquipment templateEquipment;
926 ✗ ElectricEquipmentVector myEquipment = electricEquipment();
927 ✗ if (!myEquipment.empty()) {
928 ✗ templateEquipment = myEquipment[0];
929 }
930 ✗ return setElectricEquipmentPowerPerFloorArea(*electricEquipmentPowerPerFloorArea, templateEquipment);
931 ✗ }
932
933 ✗ bool SpaceType_Impl::setElectricEquipmentPowerPerFloorArea(double electricEquipmentPowerPerFloorArea,
934 const boost::optional<ElectricEquipment>& templateElectricEquipment) {
935 ✗ if (electricEquipmentPowerPerFloorArea < 0.0) {
936 ✗ LOG(Error, "SpaceType cannot set electricEquipmentPowerPerFloorArea " << electricEquipmentPowerPerFloorArea << ", the value must be >= 0.0.");
937 ✗ return false;
938 }
939
940 // create or modify ElectricEquipment and ElectricEquipmentDefinition object
941 ✗ OptionalElectricEquipment myEquipment = getMySpaceLoadInstance<ElectricEquipment, ElectricEquipmentDefinition>(templateElectricEquipment);
942 ✗ if (!myEquipment) {
943 ✗ LOG(Error, "The templateElectricEquipment object must be in the same Model as this SpaceType.");
944 ✗ return false;
945 }
946
947 // set space type and electric equipment WattsperSpaceFloorArea
948 ✗ bool ok(true);
949 ✗ OS_ASSERT(myEquipment);
950 ✗ myEquipment->makeUnique();
951 ✗ ok = myEquipment->setSpaceType(getObject<SpaceType>());
952 ✗ OS_ASSERT(ok);
953 ✗ ok = myEquipment->electricEquipmentDefinition().setWattsperSpaceFloorArea(electricEquipmentPowerPerFloorArea);
954 ✗ OS_ASSERT(ok);
955 ✗ ok = myEquipment->setMultiplier(1);
956 ✗ OS_ASSERT(ok);
957
958 // remove all other electric equipment
959 ✗ ElectricEquipmentVector allMyEquipment = electricEquipment();
960 ✗ removeAllButOneSpaceLoadInstance<ElectricEquipment>(allMyEquipment, *myEquipment);
961
962 ✗ return true;
963 ✗ }
964
965 ✗ boost::optional<double> SpaceType_Impl::electricEquipmentPowerPerPerson() const {
966 ✗ double result(0.0);
967 ✗ for (const ElectricEquipment& equipment : electricEquipment()) {
968 ✗ OptionalDouble temp = equipment.powerPerPerson();
969 ✗ if (temp) {
970 ✗ result += temp.get();
971 } else {
972 ✗ return boost::none;
973 }
974 ✗ }
975 ✗ return result;
976 }
977
978 ✗ bool SpaceType_Impl::setElectricEquipmentPowerPerPerson(boost::optional<double> electricEquipmentPowerPerPerson) {
979 ✗ if (!electricEquipmentPowerPerPerson) {
980 ✗ return false;
981 }
982 ✗ OptionalElectricEquipment templateEquipment;
983 ✗ ElectricEquipmentVector myEquipment = electricEquipment();
984 ✗ if (!myEquipment.empty()) {
985 ✗ templateEquipment = myEquipment[0];
986 }
987 ✗ return setElectricEquipmentPowerPerPerson(*electricEquipmentPowerPerPerson, templateEquipment);
988 ✗ }
989
990 ✗ bool SpaceType_Impl::setElectricEquipmentPowerPerPerson(double electricEquipmentPowerPerPerson,
991 const boost::optional<ElectricEquipment>& templateElectricEquipment) {
992 ✗ if (electricEquipmentPowerPerPerson < 0.0) {
993 ✗ LOG(Error, "SpaceType cannot set electricEquipmentPowerPerPerson " << electricEquipmentPowerPerPerson << ", the value must be >= 0.0.");
994 ✗ return false;
995 }
996
997 // create or modify ElectricEquipment and ElectricEquipmentDefinition object
998 ✗ OptionalElectricEquipment myEquipment = getMySpaceLoadInstance<ElectricEquipment, ElectricEquipmentDefinition>(templateElectricEquipment);
999 ✗ if (!myEquipment) {
1000 ✗ LOG(Error, "The templateElectricEquipment object must be in the same Model as this SpaceType.");
1001 ✗ return false;
1002 }
1003
1004 // set space type and electric equipment WattsperSpaceFloorArea
1005 ✗ bool ok(true);
1006 ✗ OS_ASSERT(myEquipment);
1007 ✗ myEquipment->makeUnique();
1008 ✗ ok = myEquipment->setSpaceType(getObject<SpaceType>());
1009 ✗ OS_ASSERT(ok);
1010 ✗ ok = myEquipment->electricEquipmentDefinition().setWattsperPerson(electricEquipmentPowerPerPerson);
1011 ✗ OS_ASSERT(ok);
1012 ✗ ok = myEquipment->setMultiplier(1);
1013 ✗ OS_ASSERT(ok);
1014
1015 // remove all other electric equipment
1016 ✗ ElectricEquipmentVector allMyEquipment = electricEquipment();
1017 ✗ removeAllButOneSpaceLoadInstance<ElectricEquipment>(allMyEquipment, *myEquipment);
1018
1019 ✗ return true;
1020 ✗ }
1021
1022 ✗ double SpaceType_Impl::getElectricEquipmentDesignLevel(double floorArea, double numPeople) const {
1023 ✗ double result(0.0);
1024 ✗ for (const ElectricEquipment& equipment : electricEquipment()) {
1025 ✗ result += equipment.getDesignLevel(floorArea, numPeople);
1026 ✗ }
1027 ✗ return result;
1028 }
1029
1030 ✗ double SpaceType_Impl::getElectricEquipmentPowerPerFloorArea(double floorArea, double numPeople) const {
1031 ✗ double result(0.0);
1032 ✗ for (const ElectricEquipment& equipment : electricEquipment()) {
1033 ✗ result += equipment.getPowerPerFloorArea(floorArea, numPeople);
1034 ✗ }
1035 ✗ return result;
1036 }
1037
1038 ✗ double SpaceType_Impl::getElectricEquipmentPowerPerPerson(double floorArea, double numPeople) const {
1039 ✗ double result(0.0);
1040 ✗ for (const ElectricEquipment& equipment : electricEquipment()) {
1041 ✗ result += equipment.getPowerPerPerson(floorArea, numPeople);
1042 ✗ }
1043 ✗ return result;
1044 }
1045
1046 ✗ boost::optional<double> SpaceType_Impl::gasEquipmentPowerPerFloorArea() const {
1047 ✗ double result(0.0);
1048 ✗ for (const GasEquipment& equipment : gasEquipment()) {
1049 ✗ OptionalDouble temp = equipment.powerPerFloorArea();
1050 ✗ if (temp) {
1051 ✗ result += temp.get();
1052 } else {
1053 ✗ return boost::none;
1054 }
1055 ✗ }
1056 ✗ return result;
1057 }
1058
1059 ✗ bool SpaceType_Impl::setGasEquipmentPowerPerFloorArea(boost::optional<double> gasEquipmentPowerPerFloorArea) {
1060 ✗ if (!gasEquipmentPowerPerFloorArea) {
1061 ✗ return false;
1062 }
1063 ✗ OptionalGasEquipment templateEquipment;
1064 ✗ GasEquipmentVector myEquipment = gasEquipment();
1065 ✗ if (!myEquipment.empty()) {
1066 ✗ templateEquipment = myEquipment[0];
1067 }
1068 ✗ return setGasEquipmentPowerPerFloorArea(*gasEquipmentPowerPerFloorArea, templateEquipment);
1069 ✗ }
1070
1071 ✗ bool SpaceType_Impl::setGasEquipmentPowerPerFloorArea(double gasEquipmentPowerPerFloorArea,
1072 const boost::optional<GasEquipment>& templateGasEquipment) {
1073 ✗ if (gasEquipmentPowerPerFloorArea < 0.0) {
1074 ✗ LOG(Error, "SpaceType cannot set gasEquipmentPowerPerFloorArea " << gasEquipmentPowerPerFloorArea << ", the value must be >= 0.0.");
1075 ✗ return false;
1076 }
1077
1078 // create or modify GasEquipment and GasEquipmentDefinition object
1079 ✗ OptionalGasEquipment myEquipment = getMySpaceLoadInstance<GasEquipment, GasEquipmentDefinition>(templateGasEquipment);
1080 ✗ if (!myEquipment) {
1081 ✗ LOG(Error, "The templateGasEquipment object must be in the same Model as this SpaceType.");
1082 ✗ return false;
1083 }
1084
1085 // set space type and gas equipment WattsperSpaceFloorArea
1086 ✗ bool ok(true);
1087 ✗ OS_ASSERT(myEquipment);
1088 ✗ myEquipment->makeUnique();
1089 ✗ ok = myEquipment->setSpaceType(getObject<SpaceType>());
1090 ✗ OS_ASSERT(ok);
1091 ✗ ok = myEquipment->gasEquipmentDefinition().setWattsperSpaceFloorArea(gasEquipmentPowerPerFloorArea);
1092 ✗ OS_ASSERT(ok);
1093 ✗ ok = myEquipment->setMultiplier(1);
1094 ✗ OS_ASSERT(ok);
1095
1096 // remove all other gas equipment
1097 ✗ GasEquipmentVector allMyEquipment = gasEquipment();
1098 ✗ removeAllButOneSpaceLoadInstance<GasEquipment>(allMyEquipment, *myEquipment);
1099
1100 ✗ return true;
1101 ✗ }
1102
1103 ✗ boost::optional<double> SpaceType_Impl::gasEquipmentPowerPerPerson() const {
1104 ✗ double result(0.0);
1105 ✗ for (const GasEquipment& equipment : gasEquipment()) {
1106 ✗ OptionalDouble temp = equipment.powerPerPerson();
1107 ✗ if (temp) {
1108 ✗ result += temp.get();
1109 } else {
1110 ✗ return boost::none;
1111 }
1112 ✗ }
1113 ✗ return result;
1114 }
1115
1116 ✗ bool SpaceType_Impl::setGasEquipmentPowerPerPerson(boost::optional<double> gasEquipmentPowerPerPerson) {
1117 ✗ if (!gasEquipmentPowerPerPerson) {
1118 ✗ return false;
1119 }
1120 ✗ OptionalGasEquipment templateEquipment;
1121 ✗ GasEquipmentVector myEquipment = gasEquipment();
1122 ✗ if (!myEquipment.empty()) {
1123 ✗ templateEquipment = myEquipment[0];
1124 }
1125 ✗ return setGasEquipmentPowerPerPerson(*gasEquipmentPowerPerPerson, templateEquipment);
1126 ✗ }
1127
1128 ✗ bool SpaceType_Impl::setGasEquipmentPowerPerPerson(double gasEquipmentPowerPerPerson, const boost::optional<GasEquipment>& templateGasEquipment) {
1129 ✗ if (gasEquipmentPowerPerPerson < 0.0) {
1130 ✗ LOG(Error, "SpaceType cannot set gasEquipmentPowerPerPerson " << gasEquipmentPowerPerPerson << ", the value must be >= 0.0.");
1131 ✗ return false;
1132 }
1133
1134 // create or modify GasEquipment and GasEquipmentDefinition object
1135 ✗ OptionalGasEquipment myEquipment = getMySpaceLoadInstance<GasEquipment, GasEquipmentDefinition>(templateGasEquipment);
1136 ✗ if (!myEquipment) {
1137 ✗ LOG(Error, "The templateGasEquipment object must be in the same Model as this SpaceType.");
1138 ✗ return false;
1139 }
1140
1141 // set space type and gas equipment WattsperSpaceFloorArea
1142 ✗ bool ok(true);
1143 ✗ OS_ASSERT(myEquipment);
1144 ✗ myEquipment->makeUnique();
1145 ✗ ok = myEquipment->setSpaceType(getObject<SpaceType>());
1146 ✗ OS_ASSERT(ok);
1147 ✗ ok = myEquipment->gasEquipmentDefinition().setWattsperPerson(gasEquipmentPowerPerPerson);
1148 ✗ OS_ASSERT(ok);
1149 ✗ ok = myEquipment->setMultiplier(1);
1150 ✗ OS_ASSERT(ok);
1151
1152 // remove all other gas equipment
1153 ✗ GasEquipmentVector allMyEquipment = gasEquipment();
1154 ✗ removeAllButOneSpaceLoadInstance<GasEquipment>(allMyEquipment, *myEquipment);
1155
1156 ✗ return true;
1157 ✗ }
1158
1159 ✗ double SpaceType_Impl::getGasEquipmentDesignLevel(double floorArea, double numPeople) const {
1160 ✗ double result(0.0);
1161 ✗ for (const GasEquipment& equipment : gasEquipment()) {
1162 ✗ result += equipment.getDesignLevel(floorArea, numPeople);
1163 ✗ }
1164 ✗ return result;
1165 }
1166
1167 ✗ double SpaceType_Impl::getGasEquipmentPowerPerFloorArea(double floorArea, double numPeople) const {
1168 ✗ double result(0.0);
1169 ✗ for (const GasEquipment& equipment : gasEquipment()) {
1170 ✗ result += equipment.getPowerPerFloorArea(floorArea, numPeople);
1171 ✗ }
1172 ✗ return result;
1173 }
1174
1175 ✗ double SpaceType_Impl::getGasEquipmentPowerPerPerson(double floorArea, double numPeople) const {
1176 ✗ double result(0.0);
1177 ✗ for (const GasEquipment& equipment : gasEquipment()) {
1178 ✗ result += equipment.getPowerPerPerson(floorArea, numPeople);
1179 ✗ }
1180 ✗ return result;
1181 }
1182
1183 ✗ boost::optional<double> SpaceType_Impl::hotWaterEquipmentPowerPerFloorArea() const {
1184 ✗ double result(0.0);
1185 ✗ for (const HotWaterEquipment& equipment : hotWaterEquipment()) {
1186 ✗ OptionalDouble temp = equipment.powerPerFloorArea();
1187 ✗ if (temp) {
1188 ✗ result += temp.get();
1189 } else {
1190 ✗ return boost::none;
1191 }
1192 ✗ }
1193 ✗ return result;
1194 }
1195
1196 ✗ bool SpaceType_Impl::setHotWaterEquipmentPowerPerFloorArea(double hotWaterEquipmentPowerPerFloorArea) {
1197 ✗ OptionalHotWaterEquipment templateEquipment;
1198 ✗ HotWaterEquipmentVector myEquipment = hotWaterEquipment();
1199 ✗ if (!myEquipment.empty()) {
1200 ✗ templateEquipment = myEquipment[0];
1201 }
1202 ✗ return setHotWaterEquipmentPowerPerFloorArea(hotWaterEquipmentPowerPerFloorArea, templateEquipment);
1203 ✗ }
1204
1205 ✗ bool SpaceType_Impl::setHotWaterEquipmentPowerPerFloorArea(double hotWaterEquipmentPowerPerFloorArea,
1206 const boost::optional<HotWaterEquipment>& templateHotWaterEquipment) {
1207 ✗ if (hotWaterEquipmentPowerPerFloorArea < 0.0) {
1208 ✗ LOG(Error, "SpaceType cannot set hotWaterEquipmentPowerPerFloorArea " << hotWaterEquipmentPowerPerFloorArea << ", the value must be >= 0.0.");
1209 ✗ return false;
1210 }
1211
1212 // create or modify HotWaterEquipment and HotWaterEquipmentDefinition object
1213 ✗ OptionalHotWaterEquipment myEquipment = getMySpaceLoadInstance<HotWaterEquipment, HotWaterEquipmentDefinition>(templateHotWaterEquipment);
1214 ✗ if (!myEquipment) {
1215 ✗ LOG(Error, "The templateHotWaterEquipment object must be in the same Model as this SpaceType.");
1216 ✗ return false;
1217 }
1218
1219 // set space type and equipment WattsperSpaceFloorArea
1220 ✗ bool ok(true);
1221 ✗ OS_ASSERT(myEquipment);
1222 ✗ myEquipment->makeUnique();
1223 ✗ ok = myEquipment->setSpaceType(getObject<SpaceType>());
1224 ✗ OS_ASSERT(ok);
1225 ✗ ok = myEquipment->hotWaterEquipmentDefinition().setWattsperSpaceFloorArea(hotWaterEquipmentPowerPerFloorArea);
1226 ✗ OS_ASSERT(ok);
1227 ✗ ok = myEquipment->setMultiplier(1);
1228 ✗ OS_ASSERT(ok);
1229
1230 // remove all other equipment
1231 ✗ HotWaterEquipmentVector allMyEquipment = hotWaterEquipment();
1232 ✗ removeAllButOneSpaceLoadInstance<HotWaterEquipment>(allMyEquipment, *myEquipment);
1233
1234 ✗ return true;
1235 ✗ }
1236
1237 ✗ boost::optional<double> SpaceType_Impl::hotWaterEquipmentPowerPerPerson() const {
1238 ✗ double result(0.0);
1239 ✗ for (const HotWaterEquipment& equipment : hotWaterEquipment()) {
1240 ✗ OptionalDouble temp = equipment.powerPerPerson();
1241 ✗ if (temp) {
1242 ✗ result += temp.get();
1243 } else {
1244 ✗ return boost::none;
1245 }
1246 ✗ }
1247 ✗ return result;
1248 }
1249
1250 ✗ bool SpaceType_Impl::setHotWaterEquipmentPowerPerPerson(double hotWaterEquipmentPowerPerPerson) {
1251 ✗ OptionalHotWaterEquipment templateEquipment;
1252 ✗ HotWaterEquipmentVector myEquipment = hotWaterEquipment();
1253 ✗ if (!myEquipment.empty()) {
1254 ✗ templateEquipment = myEquipment[0];
1255 }
1256 ✗ return setHotWaterEquipmentPowerPerPerson(hotWaterEquipmentPowerPerPerson, templateEquipment);
1257 ✗ }
1258
1259 ✗ bool SpaceType_Impl::setHotWaterEquipmentPowerPerPerson(double hotWaterEquipmentPowerPerPerson,
1260 const boost::optional<HotWaterEquipment>& templateHotWaterEquipment) {
1261 ✗ if (hotWaterEquipmentPowerPerPerson < 0.0) {
1262 ✗ LOG(Error, "SpaceType cannot set hotWaterEquipmentPowerPerPerson " << hotWaterEquipmentPowerPerPerson << ", the value must be >= 0.0.");
1263 ✗ return false;
1264 }
1265
1266 // create or modify HotWaterEquipment and HotWaterEquipmentDefinition object
1267 ✗ OptionalHotWaterEquipment myEquipment = getMySpaceLoadInstance<HotWaterEquipment, HotWaterEquipmentDefinition>(templateHotWaterEquipment);
1268 ✗ if (!myEquipment) {
1269 ✗ LOG(Error, "The templateHotWaterEquipment object must be in the same Model as this SpaceType.");
1270 ✗ return false;
1271 }
1272
1273 // set space type and equipment WattsperSpaceFloorArea
1274 ✗ bool ok(true);
1275 ✗ OS_ASSERT(myEquipment);
1276 ✗ myEquipment->makeUnique();
1277 ✗ ok = myEquipment->setSpaceType(getObject<SpaceType>());
1278 ✗ OS_ASSERT(ok);
1279 ✗ ok = myEquipment->hotWaterEquipmentDefinition().setWattsperPerson(hotWaterEquipmentPowerPerPerson);
1280 ✗ OS_ASSERT(ok);
1281 ✗ ok = myEquipment->setMultiplier(1);
1282 ✗ OS_ASSERT(ok);
1283
1284 // remove all other equipment
1285 ✗ HotWaterEquipmentVector allMyEquipment = hotWaterEquipment();
1286 ✗ removeAllButOneSpaceLoadInstance<HotWaterEquipment>(allMyEquipment, *myEquipment);
1287
1288 ✗ return true;
1289 ✗ }
1290
1291 ✗ double SpaceType_Impl::getHotWaterEquipmentDesignLevel(double floorArea, double numPeople) const {
1292 ✗ double result(0.0);
1293 ✗ for (const HotWaterEquipment& equipment : hotWaterEquipment()) {
1294 ✗ result += equipment.getDesignLevel(floorArea, numPeople);
1295 ✗ }
1296 ✗ return result;
1297 }
1298
1299 ✗ double SpaceType_Impl::getHotWaterEquipmentPowerPerFloorArea(double floorArea, double numPeople) const {
1300 ✗ double result(0.0);
1301 ✗ for (const HotWaterEquipment& equipment : hotWaterEquipment()) {
1302 ✗ result += equipment.getPowerPerFloorArea(floorArea, numPeople);
1303 ✗ }
1304 ✗ return result;
1305 }
1306
1307 ✗ double SpaceType_Impl::getHotWaterEquipmentPowerPerPerson(double floorArea, double numPeople) const {
1308 ✗ double result(0.0);
1309 ✗ for (const HotWaterEquipment& equipment : hotWaterEquipment()) {
1310 ✗ result += equipment.getPowerPerPerson(floorArea, numPeople);
1311 ✗ }
1312 ✗ return result;
1313 }
1314
1315 17 double SpaceType_Impl::floorArea() const {
1316 17 double result = 0;
1317
4/4
✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
✓ Branch 12 taken 26 times.
✓ Branch 13 taken 17 times.
43 for (const Space& space : this->model().getConcreteModelObjects<Space>()) {
1318
1/1
✓ Branch 1 taken 26 times.
26 boost::optional<SpaceType> spaceType = space.spaceType();
1319
10/10
✓ Branch 0 taken 24 times.
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 24 times.
✓ Branch 6 taken 24 times.
✓ Branch 9 taken 24 times.
✓ Branch 12 taken 24 times.
✓ Branch 14 taken 18 times.
✓ Branch 15 taken 6 times.
✓ Branch 16 taken 18 times.
✓ Branch 17 taken 8 times.
26 if (spaceType && spaceType->handle() == this->handle()) {
1320
2/2
✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
18 result += space.multiplier() * space.floorArea();
1321 }
1322 43 }
1323 17 return result;
1324 }
1325
1326 ✗ boost::optional<ModelObject> SpaceType_Impl::defaultConstructionSetAsModelObject() const {
1327 ✗ OptionalModelObject result;
1328 ✗ OptionalDefaultConstructionSet intermediate = defaultConstructionSet();
1329 ✗ if (intermediate) {
1330 ✗ result = *intermediate;
1331 }
1332 ✗ return result;
1333 ✗ }
1334
1335 ✗ boost::optional<ModelObject> SpaceType_Impl::defaultScheduleSetAsModelObject() const {
1336 ✗ OptionalModelObject result;
1337 ✗ OptionalDefaultScheduleSet intermediate = defaultScheduleSet();
1338 ✗ if (intermediate) {
1339 ✗ result = *intermediate;
1340 }
1341 ✗ return result;
1342 ✗ }
1343
1344 ✗ boost::optional<ModelObject> SpaceType_Impl::renderingColorAsModelObject() const {
1345 ✗ OptionalModelObject result;
1346 ✗ OptionalRenderingColor intermediate = renderingColor();
1347 ✗ if (intermediate) {
1348 ✗ result = *intermediate;
1349 }
1350 ✗ return result;
1351 ✗ }
1352
1353 ✗ std::vector<ModelObject> SpaceType_Impl::internalMassAsModelObjects() const {
1354 ✗ ModelObjectVector result = castVector<ModelObject>(internalMass());
1355 ✗ return result;
1356 }
1357
1358 ✗ std::vector<ModelObject> SpaceType_Impl::peopleAsModelObjects() const {
1359 ✗ ModelObjectVector result = castVector<ModelObject>(people());
1360 ✗ return result;
1361 }
1362
1363 ✗ std::vector<ModelObject> SpaceType_Impl::lightsAsModelObjects() const {
1364 ✗ ModelObjectVector result = castVector<ModelObject>(lights());
1365 ✗ return result;
1366 }
1367
1368 ✗ std::vector<ModelObject> SpaceType_Impl::luminairesAsModelObjects() const {
1369 ✗ ModelObjectVector result = castVector<ModelObject>(luminaires());
1370 ✗ return result;
1371 }
1372
1373 ✗ std::vector<ModelObject> SpaceType_Impl::electricEquipmentAsModelObjects() const {
1374 ✗ ModelObjectVector result = castVector<ModelObject>(electricEquipment());
1375 ✗ return result;
1376 }
1377
1378 ✗ std::vector<ModelObject> SpaceType_Impl::electricEquipmentITEAirCooledAsModelObjects() const {
1379 ✗ ModelObjectVector result = castVector<ModelObject>(electricEquipmentITEAirCooled());
1380 ✗ return result;
1381 }
1382
1383 ✗ std::vector<ModelObject> SpaceType_Impl::gasEquipmentAsModelObjects() const {
1384 ✗ ModelObjectVector result = castVector<ModelObject>(gasEquipment());
1385 ✗ return result;
1386 }
1387
1388 ✗ std::vector<ModelObject> SpaceType_Impl::hotWaterEquipmentAsModelObjects() const {
1389 ✗ ModelObjectVector result = castVector<ModelObject>(hotWaterEquipment());
1390 ✗ return result;
1391 }
1392
1393 ✗ std::vector<ModelObject> SpaceType_Impl::steamEquipmentAsModelObjects() const {
1394 ✗ ModelObjectVector result = castVector<ModelObject>(steamEquipment());
1395 ✗ return result;
1396 }
1397
1398 ✗ std::vector<ModelObject> SpaceType_Impl::otherEquipmentAsModelObjects() const {
1399 ✗ ModelObjectVector result = castVector<ModelObject>(otherEquipment());
1400 ✗ return result;
1401 }
1402
1403 ✗ std::vector<ModelObject> SpaceType_Impl::spaceInfiltrationDesignFlowRatesAsModelObjects() const {
1404 ✗ ModelObjectVector result = castVector<ModelObject>(spaceInfiltrationDesignFlowRates());
1405 ✗ return result;
1406 }
1407
1408 ✗ std::vector<ModelObject> SpaceType_Impl::spaceInfiltrationEffectiveLeakageAreasAsModelObjects() const {
1409 ✗ ModelObjectVector result = castVector<ModelObject>(spaceInfiltrationEffectiveLeakageAreas());
1410 ✗ return result;
1411 }
1412
1413 ✗ std::vector<ModelObject> SpaceType_Impl::spaceInfiltrationFlowCoefficientsAsModelObjects() const {
1414 ✗ ModelObjectVector result = castVector<ModelObject>(spaceInfiltrationFlowCoefficients());
1415 ✗ return result;
1416 }
1417
1418 ✗ bool SpaceType_Impl::setDefaultConstructionSetAsModelObject(const boost::optional<ModelObject>& modelObject) {
1419 ✗ if (modelObject) {
1420 ✗ OptionalDefaultConstructionSet intermediate = modelObject->optionalCast<DefaultConstructionSet>();
1421 ✗ if (intermediate) {
1422 ✗ return setDefaultConstructionSet(*intermediate);
1423 } else {
1424 ✗ return false;
1425 }
1426 ✗ } else {
1427 ✗ resetDefaultConstructionSet();
1428 }
1429 ✗ return true;
1430 }
1431
1432 ✗ bool SpaceType_Impl::setDefaultScheduleSetAsModelObject(const boost::optional<ModelObject>& modelObject) {
1433 ✗ if (modelObject) {
1434 ✗ OptionalDefaultScheduleSet intermediate = modelObject->optionalCast<DefaultScheduleSet>();
1435 ✗ if (intermediate) {
1436 ✗ return setDefaultScheduleSet(*intermediate);
1437 } else {
1438 ✗ return false;
1439 }
1440 ✗ } else {
1441 ✗ resetDefaultScheduleSet();
1442 }
1443 ✗ return true;
1444 }
1445
1446 ✗ bool SpaceType_Impl::setRenderingColorAsModelObject(const boost::optional<ModelObject>& modelObject) {
1447 ✗ if (modelObject) {
1448 ✗ OptionalRenderingColor intermediate = modelObject->optionalCast<RenderingColor>();
1449 ✗ if (intermediate) {
1450 ✗ return setRenderingColor(*intermediate);
1451 } else {
1452 ✗ return false;
1453 }
1454 ✗ } else {
1455 ✗ resetRenderingColor();
1456 }
1457 ✗ return true;
1458 }
1459
1460 template <typename T, typename TDef>
1461 19 boost::optional<T> SpaceType_Impl::getMySpaceLoadInstance(const boost::optional<T>& templateSpaceLoadInstance) {
1462 19 boost::optional<T> result;
1463
1/10
boost::optional<openstudio::model::ElectricEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::ElectricEquipment, openstudio::model::ElectricEquipmentDefinition>(boost::optional<openstudio::model::ElectricEquipment> const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
boost::optional<openstudio::model::GasEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::GasEquipment, openstudio::model::GasEquipmentDefinition>(boost::optional<openstudio::model::GasEquipment> const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
boost::optional<openstudio::model::HotWaterEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::HotWaterEquipment, openstudio::model::HotWaterEquipmentDefinition>(boost::optional<openstudio::model::HotWaterEquipment> const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
boost::optional<openstudio::model::Lights> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::Lights, openstudio::model::LightsDefinition>(boost::optional<openstudio::model::Lights> const&):
✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
boost::optional<openstudio::model::People> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::People, openstudio::model::PeopleDefinition>(boost::optional<openstudio::model::People> const&):
✗ Branch 1 not taken.
✗ Branch 2 not taken.
19 if (!templateSpaceLoadInstance) {
1464
2/10
boost::optional<openstudio::model::ElectricEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::ElectricEquipment, openstudio::model::ElectricEquipmentDefinition>(boost::optional<openstudio::model::ElectricEquipment> const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
boost::optional<openstudio::model::GasEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::GasEquipment, openstudio::model::GasEquipmentDefinition>(boost::optional<openstudio::model::GasEquipment> const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
boost::optional<openstudio::model::HotWaterEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::HotWaterEquipment, openstudio::model::HotWaterEquipmentDefinition>(boost::optional<openstudio::model::HotWaterEquipment> const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
boost::optional<openstudio::model::Lights> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::Lights, openstudio::model::LightsDefinition>(boost::optional<openstudio::model::Lights> const&):
✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
boost::optional<openstudio::model::People> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::People, openstudio::model::PeopleDefinition>(boost::optional<openstudio::model::People> const&):
✗ Branch 1 not taken.
✗ Branch 4 not taken.
19 TDef myDefinition(model());
1465
1/5
boost::optional<openstudio::model::ElectricEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::ElectricEquipment, openstudio::model::ElectricEquipmentDefinition>(boost::optional<openstudio::model::ElectricEquipment> const&):
✗ Branch 1 not taken.
boost::optional<openstudio::model::GasEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::GasEquipment, openstudio::model::GasEquipmentDefinition>(boost::optional<openstudio::model::GasEquipment> const&):
✗ Branch 1 not taken.
boost::optional<openstudio::model::HotWaterEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::HotWaterEquipment, openstudio::model::HotWaterEquipmentDefinition>(boost::optional<openstudio::model::HotWaterEquipment> const&):
✗ Branch 1 not taken.
boost::optional<openstudio::model::Lights> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::Lights, openstudio::model::LightsDefinition>(boost::optional<openstudio::model::Lights> const&):
✓ Branch 1 taken 19 times.
boost::optional<openstudio::model::People> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::People, openstudio::model::PeopleDefinition>(boost::optional<openstudio::model::People> const&):
✗ Branch 1 not taken.
19 T myInstance(myDefinition);
1466
1/5
boost::optional<openstudio::model::ElectricEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::ElectricEquipment, openstudio::model::ElectricEquipmentDefinition>(boost::optional<openstudio::model::ElectricEquipment> const&):
✗ Branch 1 not taken.
boost::optional<openstudio::model::GasEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::GasEquipment, openstudio::model::GasEquipmentDefinition>(boost::optional<openstudio::model::GasEquipment> const&):
✗ Branch 1 not taken.
boost::optional<openstudio::model::HotWaterEquipment> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::HotWaterEquipment, openstudio::model::HotWaterEquipmentDefinition>(boost::optional<openstudio::model::HotWaterEquipment> const&):
✗ Branch 1 not taken.
boost::optional<openstudio::model::Lights> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::Lights, openstudio::model::LightsDefinition>(boost::optional<openstudio::model::Lights> const&):
✓ Branch 1 taken 19 times.
boost::optional<openstudio::model::People> openstudio::model::detail::SpaceType_Impl::getMySpaceLoadInstance<openstudio::model::People, openstudio::model::PeopleDefinition>(boost::optional<openstudio::model::People> const&):
✗ Branch 1 not taken.
19 result = myInstance;
1467 19 } else {
1468 ✗ boost::optional<SpaceType> st = templateSpaceLoadInstance->spaceType();
1469 ✗ if (st && (st.get() == getObject<SpaceType>())) {
1470 ✗ result = templateSpaceLoadInstance;
1471 ✗ } else if (templateSpaceLoadInstance->model() != model()) {
1472 ✗ return boost::none;
1473 ✗ } else if (!st && !templateSpaceLoadInstance->space()) {
1474 ✗ result = templateSpaceLoadInstance;
1475 } else {
1476 ✗ T myInstance = templateSpaceLoadInstance->clone().template cast<T>();
1477 ✗ result = myInstance;
1478 ✗ }
1479 ✗ }
1480 19 return result;
1481 19 }
1482
1483 template <typename T>
1484 19 void SpaceType_Impl::removeAllButOneSpaceLoadInstance(std::vector<T>& instances, const T& instanceToKeep) {
1485 19 int count(0);
1486
2/10
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::ElectricEquipment>(std::vector<openstudio::model::ElectricEquipment, std::allocator<openstudio::model::ElectricEquipment> >&, openstudio::model::ElectricEquipment const&):
✗ Branch 5 not taken.
✗ Branch 6 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::GasEquipment>(std::vector<openstudio::model::GasEquipment, std::allocator<openstudio::model::GasEquipment> >&, openstudio::model::GasEquipment const&):
✗ Branch 5 not taken.
✗ Branch 6 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::HotWaterEquipment>(std::vector<openstudio::model::HotWaterEquipment, std::allocator<openstudio::model::HotWaterEquipment> >&, openstudio::model::HotWaterEquipment const&):
✗ Branch 5 not taken.
✗ Branch 6 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::Lights>(std::vector<openstudio::model::Lights, std::allocator<openstudio::model::Lights> >&, openstudio::model::Lights const&):
✓ Branch 5 taken 19 times.
✓ Branch 6 taken 19 times.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::People>(std::vector<openstudio::model::People, std::allocator<openstudio::model::People> >&, openstudio::model::People const&):
✗ Branch 5 not taken.
✗ Branch 6 not taken.
38 for (auto& instance : instances) {
1487
2/15
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::ElectricEquipment>(std::vector<openstudio::model::ElectricEquipment, std::allocator<openstudio::model::ElectricEquipment> >&, openstudio::model::ElectricEquipment const&):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::GasEquipment>(std::vector<openstudio::model::GasEquipment, std::allocator<openstudio::model::GasEquipment> >&, openstudio::model::GasEquipment const&):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::HotWaterEquipment>(std::vector<openstudio::model::HotWaterEquipment, std::allocator<openstudio::model::HotWaterEquipment> >&, openstudio::model::HotWaterEquipment const&):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::Lights>(std::vector<openstudio::model::Lights, std::allocator<openstudio::model::Lights> >&, openstudio::model::Lights const&):
✓ Branch 1 taken 19 times.
✓ Branch 3 taken 19 times.
✗ Branch 4 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::People>(std::vector<openstudio::model::People, std::allocator<openstudio::model::People> >&, openstudio::model::People const&):
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
19 if (instance == instanceToKeep) {
1488 19 ++count;
1489 19 continue;
1490 }
1491 ✗ instance.remove();
1492 }
1493
1/10
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::ElectricEquipment>(std::vector<openstudio::model::ElectricEquipment, std::allocator<openstudio::model::ElectricEquipment> >&, openstudio::model::ElectricEquipment const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::GasEquipment>(std::vector<openstudio::model::GasEquipment, std::allocator<openstudio::model::GasEquipment> >&, openstudio::model::GasEquipment const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::HotWaterEquipment>(std::vector<openstudio::model::HotWaterEquipment, std::allocator<openstudio::model::HotWaterEquipment> >&, openstudio::model::HotWaterEquipment const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::Lights>(std::vector<openstudio::model::Lights, std::allocator<openstudio::model::Lights> >&, openstudio::model::Lights const&):
✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
void openstudio::model::detail::SpaceType_Impl::removeAllButOneSpaceLoadInstance<openstudio::model::People>(std::vector<openstudio::model::People, std::allocator<openstudio::model::People> >&, openstudio::model::People const&):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
19 OS_ASSERT(count == 1);
1494 19 }
1495
1496 } // namespace detail
1497
1498 631 SpaceType::SpaceType(const Model& model) : ResourceObject(SpaceType::iddObjectType(), model) {
1499
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 631 times.
✗ Branch 5 not taken.
631 OS_ASSERT(getImpl<detail::SpaceType_Impl>());
1500 631 }
1501
1502 36317 IddObjectType SpaceType::iddObjectType() {
1503
1/1
✓ Branch 1 taken 36317 times.
36317 IddObjectType result(IddObjectType::OS_SpaceType);
1504 36317 return result;
1505 }
1506
1507 19610 boost::optional<DefaultConstructionSet> SpaceType::defaultConstructionSet() const {
1508
1/1
✓ Branch 3 taken 19610 times.
19610 return getImpl<detail::SpaceType_Impl>()->defaultConstructionSet();
1509 }
1510
1511 76 bool SpaceType::setDefaultConstructionSet(const DefaultConstructionSet& defaultConstructionSet) {
1512
1/1
✓ Branch 3 taken 76 times.
76 return getImpl<detail::SpaceType_Impl>()->setDefaultConstructionSet(defaultConstructionSet);
1513 }
1514
1515 85 void SpaceType::resetDefaultConstructionSet() {
1516
1/1
✓ Branch 3 taken 85 times.
85 getImpl<detail::SpaceType_Impl>()->resetDefaultConstructionSet();
1517 85 }
1518
1519 588 boost::optional<DefaultScheduleSet> SpaceType::defaultScheduleSet() const {
1520
1/1
✓ Branch 3 taken 588 times.
588 return getImpl<detail::SpaceType_Impl>()->defaultScheduleSet();
1521 }
1522
1523 490 boost::optional<Schedule> SpaceType::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const {
1524
1/1
✓ Branch 3 taken 490 times.
490 return getImpl<detail::SpaceType_Impl>()->getDefaultSchedule(defaultScheduleType);
1525 }
1526
1527 5 bool SpaceType::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) {
1528
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::SpaceType_Impl>()->setDefaultScheduleSet(defaultScheduleSet);
1529 }
1530
1531 85 void SpaceType::resetDefaultScheduleSet() {
1532
1/1
✓ Branch 3 taken 85 times.
85 getImpl<detail::SpaceType_Impl>()->resetDefaultScheduleSet();
1533 85 }
1534
1535 2332 boost::optional<RenderingColor> SpaceType::renderingColor() const {
1536
1/1
✓ Branch 3 taken 2332 times.
2332 return getImpl<detail::SpaceType_Impl>()->renderingColor();
1537 }
1538
1539 205 bool SpaceType::setRenderingColor(const RenderingColor& renderingColor) {
1540
1/1
✓ Branch 3 taken 205 times.
205 return getImpl<detail::SpaceType_Impl>()->setRenderingColor(renderingColor);
1541 }
1542
1543 85 void SpaceType::resetRenderingColor() {
1544
1/1
✓ Branch 3 taken 85 times.
85 getImpl<detail::SpaceType_Impl>()->resetRenderingColor();
1545 85 }
1546
1547 1 boost::optional<std::string> SpaceType::standardsTemplate() const {
1548
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::SpaceType_Impl>()->standardsTemplate();
1549 }
1550
1551 4 std::vector<std::string> SpaceType::suggestedStandardsTemplates() const {
1552
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::SpaceType_Impl>()->suggestedStandardsTemplates();
1553 }
1554
1555 3 bool SpaceType::setStandardsTemplate(const std::string& standardsTemplate) {
1556
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SpaceType_Impl>()->setStandardsTemplate(standardsTemplate);
1557 }
1558
1559 ✗ void SpaceType::resetStandardsTemplate() {
1560 ✗ getImpl<detail::SpaceType_Impl>()->resetStandardsTemplate();
1561 ✗ }
1562
1563 19 boost::optional<std::string> SpaceType::standardsBuildingType() const {
1564
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::SpaceType_Impl>()->standardsBuildingType();
1565 }
1566
1567 8 std::vector<std::string> SpaceType::suggestedStandardsBuildingTypes() const {
1568
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::SpaceType_Impl>()->suggestedStandardsBuildingTypes();
1569 }
1570
1571 3 bool SpaceType::setStandardsBuildingType(const std::string& standardsBuildingType) {
1572
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SpaceType_Impl>()->setStandardsBuildingType(standardsBuildingType);
1573 }
1574
1575 ✗ void SpaceType::resetStandardsBuildingType() {
1576 ✗ getImpl<detail::SpaceType_Impl>()->resetStandardsBuildingType();
1577 ✗ }
1578
1579 21 boost::optional<std::string> SpaceType::standardsSpaceType() const {
1580
1/1
✓ Branch 3 taken 21 times.
21 return getImpl<detail::SpaceType_Impl>()->standardsSpaceType();
1581 }
1582
1583 10 std::vector<std::string> SpaceType::suggestedStandardsSpaceTypes() const {
1584
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::SpaceType_Impl>()->suggestedStandardsSpaceTypes();
1585 }
1586
1587 3 bool SpaceType::setStandardsSpaceType(const std::string& standardsSpaceType) {
1588
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SpaceType_Impl>()->setStandardsSpaceType(standardsSpaceType);
1589 }
1590
1591 ✗ void SpaceType::resetStandardsSpaceType() {
1592 ✗ getImpl<detail::SpaceType_Impl>()->resetStandardsSpaceType();
1593 ✗ }
1594
1595 542 std::vector<Space> SpaceType::spaces() const {
1596
1/1
✓ Branch 3 taken 542 times.
542 return getImpl<detail::SpaceType_Impl>()->spaces();
1597 }
1598
1599 174 std::vector<InternalMass> SpaceType::internalMass() const {
1600
1/1
✓ Branch 3 taken 174 times.
174 return getImpl<detail::SpaceType_Impl>()->internalMass();
1601 }
1602
1603 908 std::vector<People> SpaceType::people() const {
1604
1/1
✓ Branch 3 taken 908 times.
908 return getImpl<detail::SpaceType_Impl>()->people();
1605 }
1606
1607 348 std::vector<Lights> SpaceType::lights() const {
1608
1/1
✓ Branch 3 taken 348 times.
348 return getImpl<detail::SpaceType_Impl>()->lights();
1609 }
1610
1611 342 std::vector<Luminaire> SpaceType::luminaires() const {
1612
1/1
✓ Branch 3 taken 342 times.
342 return getImpl<detail::SpaceType_Impl>()->luminaires();
1613 }
1614
1615 302 std::vector<ElectricEquipment> SpaceType::electricEquipment() const {
1616
1/1
✓ Branch 3 taken 302 times.
302 return getImpl<detail::SpaceType_Impl>()->electricEquipment();
1617 }
1618
1619 339 std::vector<ElectricEquipmentITEAirCooled> SpaceType::electricEquipmentITEAirCooled() const {
1620
1/1
✓ Branch 3 taken 339 times.
339 return getImpl<detail::SpaceType_Impl>()->electricEquipmentITEAirCooled();
1621 }
1622
1623 211 std::vector<GasEquipment> SpaceType::gasEquipment() const {
1624
1/1
✓ Branch 3 taken 211 times.
211 return getImpl<detail::SpaceType_Impl>()->gasEquipment();
1625 }
1626
1627 210 std::vector<HotWaterEquipment> SpaceType::hotWaterEquipment() const {
1628
1/1
✓ Branch 3 taken 210 times.
210 return getImpl<detail::SpaceType_Impl>()->hotWaterEquipment();
1629 }
1630
1631 174 std::vector<SteamEquipment> SpaceType::steamEquipment() const {
1632
1/1
✓ Branch 3 taken 174 times.
174 return getImpl<detail::SpaceType_Impl>()->steamEquipment();
1633 }
1634
1635 174 std::vector<OtherEquipment> SpaceType::otherEquipment() const {
1636
1/1
✓ Branch 3 taken 174 times.
174 return getImpl<detail::SpaceType_Impl>()->otherEquipment();
1637 }
1638
1639 31 std::vector<SpaceInfiltrationDesignFlowRate> SpaceType::spaceInfiltrationDesignFlowRates() const {
1640
1/1
✓ Branch 3 taken 31 times.
31 return getImpl<detail::SpaceType_Impl>()->spaceInfiltrationDesignFlowRates();
1641 }
1642
1643 157 std::vector<SpaceInfiltrationEffectiveLeakageArea> SpaceType::spaceInfiltrationEffectiveLeakageAreas() const {
1644
1/1
✓ Branch 3 taken 157 times.
157 return getImpl<detail::SpaceType_Impl>()->spaceInfiltrationEffectiveLeakageAreas();
1645 }
1646
1647 160 std::vector<SpaceInfiltrationFlowCoefficient> SpaceType::spaceInfiltrationFlowCoefficients() const {
1648
1/1
✓ Branch 3 taken 160 times.
160 return getImpl<detail::SpaceType_Impl>()->spaceInfiltrationFlowCoefficients();
1649 }
1650
1651 554 boost::optional<DesignSpecificationOutdoorAir> SpaceType::designSpecificationOutdoorAir() const {
1652
1/1
✓ Branch 3 taken 554 times.
554 return getImpl<detail::SpaceType_Impl>()->designSpecificationOutdoorAir();
1653 }
1654
1655 ✗ bool SpaceType::isDesignSpecificationOutdoorAirDefaulted() const {
1656 ✗ return getImpl<detail::SpaceType_Impl>()->isDesignSpecificationOutdoorAirDefaulted();
1657 }
1658
1659 5 bool SpaceType::setDesignSpecificationOutdoorAir(const DesignSpecificationOutdoorAir& designSpecificationOutdoorAir) {
1660
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::SpaceType_Impl>()->setDesignSpecificationOutdoorAir(designSpecificationOutdoorAir);
1661 }
1662
1663 ✗ void SpaceType::resetDesignSpecificationOutdoorAir() {
1664 ✗ return getImpl<detail::SpaceType_Impl>()->resetDesignSpecificationOutdoorAir();
1665 }
1666
1667 58 void SpaceType::hardApplySpaceLoadSchedules() {
1668
1/1
✓ Branch 3 taken 58 times.
58 getImpl<detail::SpaceType_Impl>()->hardApplySpaceLoadSchedules();
1669 58 }
1670
1671 ✗ boost::optional<double> SpaceType::peoplePerFloorArea() const {
1672 ✗ return getImpl<detail::SpaceType_Impl>()->peoplePerFloorArea();
1673 }
1674
1675 ✗ bool SpaceType::setPeoplePerFloorArea(double peoplePerFloorArea) {
1676 ✗ return getImpl<detail::SpaceType_Impl>()->setPeoplePerFloorArea(peoplePerFloorArea);
1677 }
1678
1679 ✗ bool SpaceType::setPeoplePerFloorArea(double peoplePerFloorArea, const People& templatePeople) {
1680 ✗ return getImpl<detail::SpaceType_Impl>()->setPeoplePerFloorArea(peoplePerFloorArea, templatePeople);
1681 }
1682
1683 ✗ boost::optional<double> SpaceType::spaceFloorAreaPerPerson() const {
1684 ✗ return getImpl<detail::SpaceType_Impl>()->spaceFloorAreaPerPerson();
1685 }
1686
1687 ✗ bool SpaceType::setSpaceFloorAreaPerPerson(double spaceFloorAreaPerPerson) {
1688 ✗ return getImpl<detail::SpaceType_Impl>()->setSpaceFloorAreaPerPerson(spaceFloorAreaPerPerson);
1689 }
1690
1691 ✗ bool SpaceType::setSpaceFloorAreaPerPerson(double spaceFloorAreaPerPerson, const People& templatePeople) {
1692 ✗ return getImpl<detail::SpaceType_Impl>()->setSpaceFloorAreaPerPerson(spaceFloorAreaPerPerson, templatePeople);
1693 }
1694
1695 1 double SpaceType::getNumberOfPeople(double floorArea) const {
1696
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::SpaceType_Impl>()->getNumberOfPeople(floorArea);
1697 }
1698
1699 1 double SpaceType::getPeoplePerFloorArea(double floorArea) const {
1700
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::SpaceType_Impl>()->getPeoplePerFloorArea(floorArea);
1701 }
1702
1703 1 double SpaceType::getFloorAreaPerPerson(double floorArea) const {
1704
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::SpaceType_Impl>()->getFloorAreaPerPerson(floorArea);
1705 }
1706
1707 ✗ boost::optional<double> SpaceType::lightingPowerPerFloorArea() const {
1708 ✗ return getImpl<detail::SpaceType_Impl>()->lightingPowerPerFloorArea();
1709 }
1710
1711 19 bool SpaceType::setLightingPowerPerFloorArea(double lightingPowerPerFloorArea) {
1712
2/2
✓ Branch 3 taken 19 times.
✓ Branch 6 taken 19 times.
19 return getImpl<detail::SpaceType_Impl>()->setLightingPowerPerFloorArea(lightingPowerPerFloorArea);
1713 }
1714
1715 ✗ bool SpaceType::setLightingPowerPerFloorArea(double lightingPowerPerFloorArea, const Lights& templateLights) {
1716 ✗ return getImpl<detail::SpaceType_Impl>()->setLightingPowerPerFloorArea(lightingPowerPerFloorArea, templateLights);
1717 }
1718
1719 ✗ boost::optional<double> SpaceType::lightingPowerPerPerson() const {
1720 ✗ return getImpl<detail::SpaceType_Impl>()->lightingPowerPerPerson();
1721 }
1722
1723 ✗ bool SpaceType::setLightingPowerPerPerson(double lightingPowerPerPerson) {
1724 ✗ return getImpl<detail::SpaceType_Impl>()->setLightingPowerPerPerson(lightingPowerPerPerson);
1725 }
1726
1727 ✗ bool SpaceType::setLightingPowerPerPerson(double lightingPowerPerPerson, const Lights& templateLights) {
1728 ✗ return getImpl<detail::SpaceType_Impl>()->setLightingPowerPerPerson(lightingPowerPerPerson, templateLights);
1729 }
1730
1731 ✗ double SpaceType::getLightingPower(double floorArea, double numPeople) const {
1732 ✗ return getImpl<detail::SpaceType_Impl>()->getLightingPower(floorArea, numPeople);
1733 }
1734
1735 ✗ double SpaceType::getLightingPowerPerFloorArea(double floorArea, double numPeople) const {
1736 ✗ return getImpl<detail::SpaceType_Impl>()->getLightingPowerPerFloorArea(floorArea, numPeople);
1737 }
1738
1739 ✗ double SpaceType::getLightingPowerPerPerson(double floorArea, double numPeople) const {
1740 ✗ return getImpl<detail::SpaceType_Impl>()->getLightingPowerPerPerson(floorArea, numPeople);
1741 }
1742
1743 ✗ boost::optional<double> SpaceType::electricEquipmentPowerPerFloorArea() const {
1744 ✗ return getImpl<detail::SpaceType_Impl>()->electricEquipmentPowerPerFloorArea();
1745 }
1746
1747 ✗ boost::optional<double> SpaceType::electricEquipmentITEAirCooledPowerPerFloorArea() const {
1748 ✗ return getImpl<detail::SpaceType_Impl>()->electricEquipmentITEAirCooledPowerPerFloorArea();
1749 }
1750
1751 ✗ bool SpaceType::setElectricEquipmentPowerPerFloorArea(double electricEquipmentPowerPerFloorArea) {
1752 ✗ return getImpl<detail::SpaceType_Impl>()->setElectricEquipmentPowerPerFloorArea(electricEquipmentPowerPerFloorArea);
1753 }
1754
1755 ✗ bool SpaceType::setElectricEquipmentPowerPerFloorArea(double electricEquipmentPowerPerFloorArea,
1756 const ElectricEquipment& templateElectricEquipment) {
1757 ✗ return getImpl<detail::SpaceType_Impl>()->setElectricEquipmentPowerPerFloorArea(electricEquipmentPowerPerFloorArea, templateElectricEquipment);
1758 }
1759
1760 ✗ boost::optional<double> SpaceType::electricEquipmentPowerPerPerson() const {
1761 ✗ return getImpl<detail::SpaceType_Impl>()->electricEquipmentPowerPerPerson();
1762 }
1763
1764 ✗ bool SpaceType::setElectricEquipmentPowerPerPerson(double electricEquipmentPowerPerPerson) {
1765 ✗ return getImpl<detail::SpaceType_Impl>()->setElectricEquipmentPowerPerPerson(electricEquipmentPowerPerPerson);
1766 }
1767
1768 ✗ bool SpaceType::setElectricEquipmentPowerPerPerson(double electricEquipmentPowerPerPerson, const ElectricEquipment& templateElectricEquipment) {
1769 ✗ return getImpl<detail::SpaceType_Impl>()->setElectricEquipmentPowerPerPerson(electricEquipmentPowerPerPerson, templateElectricEquipment);
1770 }
1771
1772 ✗ double SpaceType::getElectricEquipmentDesignLevel(double floorArea, double numPeople) const {
1773 ✗ return getImpl<detail::SpaceType_Impl>()->getElectricEquipmentDesignLevel(floorArea, numPeople);
1774 }
1775
1776 ✗ double SpaceType::getElectricEquipmentPowerPerFloorArea(double floorArea, double numPeople) const {
1777 ✗ return getImpl<detail::SpaceType_Impl>()->getElectricEquipmentPowerPerFloorArea(floorArea, numPeople);
1778 }
1779
1780 ✗ double SpaceType::getElectricEquipmentPowerPerPerson(double floorArea, double numPeople) const {
1781 ✗ return getImpl<detail::SpaceType_Impl>()->getElectricEquipmentPowerPerPerson(floorArea, numPeople);
1782 }
1783
1784 ✗ boost::optional<double> SpaceType::gasEquipmentPowerPerFloorArea() const {
1785 ✗ return getImpl<detail::SpaceType_Impl>()->gasEquipmentPowerPerFloorArea();
1786 }
1787
1788 ✗ bool SpaceType::setGasEquipmentPowerPerFloorArea(double gasEquipmentPowerPerFloorArea) {
1789 ✗ return getImpl<detail::SpaceType_Impl>()->setGasEquipmentPowerPerFloorArea(gasEquipmentPowerPerFloorArea);
1790 }
1791
1792 ✗ bool SpaceType::setGasEquipmentPowerPerFloorArea(double gasEquipmentPowerPerFloorArea, const GasEquipment& templateGasEquipment) {
1793 ✗ return getImpl<detail::SpaceType_Impl>()->setGasEquipmentPowerPerFloorArea(gasEquipmentPowerPerFloorArea, templateGasEquipment);
1794 }
1795
1796 ✗ boost::optional<double> SpaceType::gasEquipmentPowerPerPerson() const {
1797 ✗ return getImpl<detail::SpaceType_Impl>()->gasEquipmentPowerPerPerson();
1798 }
1799
1800 ✗ bool SpaceType::setGasEquipmentPowerPerPerson(double gasEquipmentPowerPerPerson) {
1801 ✗ return getImpl<detail::SpaceType_Impl>()->setGasEquipmentPowerPerPerson(gasEquipmentPowerPerPerson);
1802 }
1803
1804 ✗ bool SpaceType::setGasEquipmentPowerPerPerson(double gasEquipmentPowerPerPerson, const GasEquipment& templateGasEquipment) {
1805 ✗ return getImpl<detail::SpaceType_Impl>()->setGasEquipmentPowerPerPerson(gasEquipmentPowerPerPerson, templateGasEquipment);
1806 }
1807
1808 ✗ double SpaceType::getGasEquipmentDesignLevel(double floorArea, double numPeople) const {
1809 ✗ return getImpl<detail::SpaceType_Impl>()->getGasEquipmentDesignLevel(floorArea, numPeople);
1810 }
1811
1812 ✗ double SpaceType::getGasEquipmentPowerPerFloorArea(double floorArea, double numPeople) const {
1813 ✗ return getImpl<detail::SpaceType_Impl>()->getGasEquipmentPowerPerFloorArea(floorArea, numPeople);
1814 }
1815
1816 ✗ double SpaceType::getGasEquipmentPowerPerPerson(double floorArea, double numPeople) const {
1817 ✗ return getImpl<detail::SpaceType_Impl>()->getGasEquipmentPowerPerPerson(floorArea, numPeople);
1818 }
1819
1820 ✗ boost::optional<double> SpaceType::hotWaterEquipmentPowerPerFloorArea() const {
1821 ✗ return getImpl<detail::SpaceType_Impl>()->hotWaterEquipmentPowerPerFloorArea();
1822 }
1823
1824 ✗ bool SpaceType::setHotWaterEquipmentPowerPerFloorArea(double hotWaterEquipmentPowerPerFloorArea) {
1825 ✗ return getImpl<detail::SpaceType_Impl>()->setHotWaterEquipmentPowerPerFloorArea(hotWaterEquipmentPowerPerFloorArea);
1826 }
1827
1828 ✗ bool SpaceType::setHotWaterEquipmentPowerPerFloorArea(double hotWaterEquipmentPowerPerFloorArea,
1829 const HotWaterEquipment& templateHotWaterEquipment) {
1830 ✗ return getImpl<detail::SpaceType_Impl>()->setHotWaterEquipmentPowerPerFloorArea(hotWaterEquipmentPowerPerFloorArea, templateHotWaterEquipment);
1831 }
1832
1833 ✗ boost::optional<double> SpaceType::hotWaterEquipmentPowerPerPerson() const {
1834 ✗ return getImpl<detail::SpaceType_Impl>()->hotWaterEquipmentPowerPerPerson();
1835 }
1836
1837 ✗ bool SpaceType::setHotWaterEquipmentPowerPerPerson(double hotWaterEquipmentPowerPerPerson) {
1838 ✗ return getImpl<detail::SpaceType_Impl>()->setHotWaterEquipmentPowerPerPerson(hotWaterEquipmentPowerPerPerson);
1839 }
1840
1841 ✗ bool SpaceType::setHotWaterEquipmentPowerPerPerson(double hotWaterEquipmentPowerPerPerson, const HotWaterEquipment& templateHotWaterEquipment) {
1842 ✗ return getImpl<detail::SpaceType_Impl>()->setHotWaterEquipmentPowerPerPerson(hotWaterEquipmentPowerPerPerson, templateHotWaterEquipment);
1843 }
1844
1845 ✗ double SpaceType::getHotWaterEquipmentDesignLevel(double floorArea, double numPeople) const {
1846 ✗ return getImpl<detail::SpaceType_Impl>()->getHotWaterEquipmentDesignLevel(floorArea, numPeople);
1847 }
1848
1849 ✗ double SpaceType::getHotWaterEquipmentPowerPerFloorArea(double floorArea, double numPeople) const {
1850 ✗ return getImpl<detail::SpaceType_Impl>()->getHotWaterEquipmentPowerPerFloorArea(floorArea, numPeople);
1851 }
1852
1853 ✗ double SpaceType::getHotWaterEquipmentPowerPerPerson(double floorArea, double numPeople) const {
1854 ✗ return getImpl<detail::SpaceType_Impl>()->getHotWaterEquipmentPowerPerPerson(floorArea, numPeople);
1855 }
1856
1857 17 double SpaceType::floorArea() const {
1858
1/1
✓ Branch 3 taken 17 times.
17 return getImpl<detail::SpaceType_Impl>()->floorArea();
1859 }
1860
1861 1 boost::optional<std::string> SpaceType::setNameProtected(const std::string& newName) {
1862
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::SpaceType_Impl>()->setNameProtected(newName);
1863 }
1864
1865 /// @cond
1866
1/1
✓ Branch 3 taken 81900 times.
81900 SpaceType::SpaceType(std::shared_ptr<detail::SpaceType_Impl> impl) : ResourceObject(std::move(impl)) {}
1867 /// @endcond
1868
1869 } // namespace model
1870 } // namespace openstudio
1871