openstudio-geb 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/LICENSE.md +0 -0
  4. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/README.md +0 -0
  5. data/lib/measures/{Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation → add_rooftop_pv_simple}/README.md.erb +0 -0
  6. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/measure.rb +0 -0
  7. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/measure.xml +0 -0
  8. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/tests/CZ06RV2.epw +0 -0
  9. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/tests/add_rooftop_pv_test.rb +0 -0
  10. data/lib/measures/{add_rooftop_pv → add_rooftop_pv_simple}/tests/pv_test_input.osm +0 -0
  11. data/lib/openstudio/geb/utilities.rb +34 -6
  12. data/lib/openstudio/geb/version.rb +1 -1
  13. data/openstudio-geb.gemspec +1 -1
  14. metadata +10 -126
  15. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/files/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw +0 -8768
  16. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/files/USA_NY_Buffalo.Niagara.Intl.AP.725280_TMY3.epw +0 -8768
  17. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation/LICENSE.md +0 -27
  18. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation/README.md +0 -32
  19. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation/measure.rb +0 -156
  20. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation/measure.xml +0 -117
  21. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation/tests/0320_ModelWithHVAC_01.osm +0 -22223
  22. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Enable Demand Controlled Ventilation/tests/EnableDemandControlledVentilation_Test.rb +0 -123
  23. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/LICENSE.md +0 -27
  24. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/README.md +0 -136
  25. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/README.md.erb +0 -47
  26. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/measure.rb +0 -586
  27. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/measure.xml +0 -200
  28. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/tests/EnvelopeAndLoadTestModel_01.osm +0 -14352
  29. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/tests/EnvelopeAndLoadTestModel_01_Costed.osm +0 -14438
  30. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/tests/HasSpaceWithNoLightsOrElec.osm +0 -16531
  31. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/measures/Set Electric Equipment loads by EPD/tests/ReplaceElectricEquipmentWithEPD_Test.rb +0 -592
  32. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/out.osw +0 -68
  33. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/reports/eplustbl.html +0 -27183
  34. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/data_point.zip +0 -0
  35. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/data_point_out.json +0 -6
  36. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.audit +0 -49
  37. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.bnd +0 -1103
  38. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.eio +0 -630
  39. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.end +0 -1
  40. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.err +0 -331
  41. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.eso +0 -158559
  42. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.mdd +0 -336
  43. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.mtd +0 -2519
  44. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.rdd +0 -638
  45. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.shd +0 -902
  46. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusout.sql +0 -0
  47. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplusssz.csv +0 -147
  48. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/eplustbl.htm +0 -27183
  49. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/epluszsz.csv +0 -148
  50. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/finished.job +0 -1
  51. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/in.idf +0 -10384
  52. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/in.osm +0 -13809
  53. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/measure_attributes.json +0 -6
  54. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/objectives.json +0 -2
  55. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/pre-preprocess.idf +0 -10134
  56. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/results.json +0 -6
  57. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/run.log +0 -0
  58. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/sqlite.err +0 -1
  59. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/started.job +0 -1
  60. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/stdout-energyplus +0 -271
  61. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/run/stdout-expandobject +0 -3
  62. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/stderr +0 -0
  63. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/stdout +0 -0
  64. data/lib/measures/Enable Demand Controlled Ventilation/tests/MediumOffice-90.1-2010-ASHRAE 169-2013-5A_dcv/workflow.osw +0 -19
  65. data/lib/measures/add_rooftop_pv/README.md.erb +0 -42
@@ -1,592 +0,0 @@
1
- # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
3
- # All rights reserved.
4
- # Redistribution and use in source and binary forms, with or without
5
- # modification, are permitted provided that the following conditions are met:
6
- #
7
- # (1) Redistributions of source code must retain the above copyright notice,
8
- # this list of conditions and the following disclaimer.
9
- #
10
- # (2) Redistributions in binary form must reproduce the above copyright notice,
11
- # this list of conditions and the following disclaimer in the documentation
12
- # and/or other materials provided with the distribution.
13
- #
14
- # (3) Neither the name of the copyright holder nor the names of any contributors
15
- # may be used to endorse or promote products derived from this software without
16
- # specific prior written permission from the respective party.
17
- #
18
- # (4) Other than as required in clauses (1) and (2), distributions in any form
19
- # of modifications or other derivative works may not use the "OpenStudio"
20
- # trademark, "OS", "os", or any other confusingly similar designation without
21
- # specific prior written permission from Alliance for Sustainable Energy, LLC.
22
- #
23
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
24
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25
- # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
27
- # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
28
- # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29
- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
30
- # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32
- # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33
- # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
- # *******************************************************************************
35
-
36
- require 'openstudio'
37
- require 'openstudio/measure/ShowRunnerOutput'
38
- require 'fileutils'
39
-
40
- require_relative '../measure.rb'
41
- require 'minitest/autorun'
42
-
43
- class SetElectricEquipmentLoadsByEPD_Test < Minitest::Test
44
- def test_SetElectricEquipmentLoadsByEPD_a
45
- # create an instance of the measure
46
- measure = SetElectricEquipmentLoadsByEPD.new
47
-
48
- # create an instance of a runner
49
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
50
-
51
- # make an empty model
52
- model = OpenStudio::Model::Model.new
53
-
54
- # get arguments and test that they are what we are expecting
55
- arguments = measure.arguments(model)
56
- assert_equal(10, arguments.size)
57
- assert_equal('space_type', arguments[0].name)
58
- assert_equal('epd', arguments[1].name)
59
- assert_equal(1.0, arguments[1].defaultValueAsDouble)
60
-
61
- # set argument values to bad values and run the measure
62
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
63
-
64
- count = -1
65
-
66
- space_type = arguments[count += 1].clone
67
- assert(space_type.setValue('*Entire Building*'))
68
- argument_map['space_type'] = space_type
69
-
70
- epd = arguments[count += 1].clone
71
- assert(epd.setValue(9000.0))
72
- argument_map['epd'] = epd
73
-
74
- add_instance_all_spaces = arguments[count += 1].clone
75
- assert(add_instance_all_spaces.setValue(false))
76
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
77
-
78
- material_cost = arguments[count += 1].clone
79
- assert(material_cost.setValue(5.0))
80
- argument_map['material_cost'] = material_cost
81
-
82
- demolition_cost = arguments[count += 1].clone
83
- assert(demolition_cost.setValue(1.0))
84
- argument_map['demolition_cost'] = demolition_cost
85
-
86
- years_until_costs_start = arguments[count += 1].clone
87
- assert(years_until_costs_start.setValue(0))
88
- argument_map['years_until_costs_start'] = years_until_costs_start
89
-
90
- demo_cost_initial_const = arguments[count += 1].clone
91
- assert(demo_cost_initial_const.setValue(false))
92
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
93
-
94
- expected_life = arguments[count += 1].clone
95
- assert(expected_life.setValue(20))
96
- argument_map['expected_life'] = expected_life
97
-
98
- om_cost = arguments[count += 1].clone
99
- assert(om_cost.setValue(0.25))
100
- argument_map['om_cost'] = om_cost
101
-
102
- om_frequency = arguments[count += 1].clone
103
- assert(om_frequency.setValue(1))
104
- argument_map['om_frequency'] = om_frequency
105
-
106
- measure.run(model, runner, argument_map)
107
- result = runner.result
108
- assert(result.value.valueName == 'Fail')
109
- end
110
-
111
- def test_SetElectricEquipmentLoadsByEPD_b
112
- # create an instance of the measure
113
- measure = SetElectricEquipmentLoadsByEPD.new
114
- # create an instance of a runner
115
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
116
- # make an empty model
117
- model = OpenStudio::Model::Model.new
118
-
119
- # get arguments and test that they are what we are expecting
120
- arguments = measure.arguments(model)
121
-
122
- # set argument values to highish values and run the measure on empty model
123
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
124
-
125
- count = -1
126
-
127
- space_type = arguments[count += 1].clone
128
- assert(space_type.setValue('*Entire Building*'))
129
- argument_map['space_type'] = space_type
130
-
131
- epd = arguments[count += 1].clone
132
- assert(epd.setValue(25.0))
133
- argument_map['epd'] = epd
134
-
135
- add_instance_all_spaces = arguments[count += 1].clone
136
- assert(add_instance_all_spaces.setValue(false))
137
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
138
-
139
- material_cost = arguments[count += 1].clone
140
- assert(material_cost.setValue(5.0))
141
- argument_map['material_cost'] = material_cost
142
-
143
- demolition_cost = arguments[count += 1].clone
144
- assert(demolition_cost.setValue(1.0))
145
- argument_map['demolition_cost'] = demolition_cost
146
-
147
- years_until_costs_start = arguments[count += 1].clone
148
- assert(years_until_costs_start.setValue(0))
149
- argument_map['years_until_costs_start'] = years_until_costs_start
150
-
151
- demo_cost_initial_const = arguments[count += 1].clone
152
- assert(demo_cost_initial_const.setValue(false))
153
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
154
-
155
- expected_life = arguments[count += 1].clone
156
- assert(expected_life.setValue(20))
157
- argument_map['expected_life'] = expected_life
158
-
159
- om_cost = arguments[count += 1].clone
160
- assert(om_cost.setValue(0.25))
161
- argument_map['om_cost'] = om_cost
162
-
163
- om_frequency = arguments[count += 1].clone
164
- assert(om_frequency.setValue(1))
165
- argument_map['om_frequency'] = om_frequency
166
-
167
- measure.run(model, runner, argument_map)
168
- result = runner.result
169
- assert(result.value.valueName == 'NA')
170
- # assert(result.warnings.size == 1)
171
- end
172
-
173
- def test_SetElectricEquipmentLoadsByEPD_c
174
- # create an instance of the measure
175
- measure = SetElectricEquipmentLoadsByEPD.new
176
- # create an instance of a runner
177
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
178
-
179
- # load the test model
180
- translator = OpenStudio::OSVersion::VersionTranslator.new
181
- path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm')
182
- model = translator.loadModel(path)
183
- assert(!model.empty?)
184
- model = model.get
185
-
186
- # refresh arguments
187
- arguments = measure.arguments(model)
188
-
189
- # set argument values to good values and run the measure on entire model with spaces
190
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
191
-
192
- count = -1
193
-
194
- space_type = arguments[count += 1].clone
195
- assert(space_type.setValue('*Entire Building*'))
196
- argument_map['space_type'] = space_type
197
-
198
- epd = arguments[count += 1].clone
199
- assert(epd.setValue(5.0))
200
- argument_map['epd'] = epd
201
-
202
- add_instance_all_spaces = arguments[count += 1].clone
203
- assert(add_instance_all_spaces.setValue(false))
204
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
205
-
206
- material_cost = arguments[count += 1].clone
207
- assert(material_cost.setValue(5.0))
208
- argument_map['material_cost'] = material_cost
209
-
210
- demolition_cost = arguments[count += 1].clone
211
- assert(demolition_cost.setValue(1.0))
212
- argument_map['demolition_cost'] = demolition_cost
213
-
214
- years_until_costs_start = arguments[count += 1].clone
215
- assert(years_until_costs_start.setValue(0))
216
- argument_map['years_until_costs_start'] = years_until_costs_start
217
-
218
- demo_cost_initial_const = arguments[count += 1].clone
219
- assert(demo_cost_initial_const.setValue(false))
220
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
221
-
222
- expected_life = arguments[count += 1].clone
223
- assert(expected_life.setValue(20))
224
- argument_map['expected_life'] = expected_life
225
-
226
- om_cost = arguments[count += 1].clone
227
- assert(om_cost.setValue(0.25))
228
- argument_map['om_cost'] = om_cost
229
-
230
- om_frequency = arguments[count += 1].clone
231
- assert(om_frequency.setValue(1))
232
- argument_map['om_frequency'] = om_frequency
233
-
234
- measure.run(model, runner, argument_map)
235
- result = runner.result
236
- show_output(result)
237
- assert(result.value.valueName == 'Success')
238
- # assert(result.warnings.size == 4)
239
- end
240
-
241
- def test_SetElectricEquipmentLoadsByEPD_d
242
- # create an instance of the measure
243
- measure = SetElectricEquipmentLoadsByEPD.new
244
- # create an instance of a runner
245
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
246
-
247
- # re-load the test model
248
- translator = OpenStudio::OSVersion::VersionTranslator.new
249
- path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm')
250
- model = translator.loadModel(path)
251
- assert(!model.empty?)
252
- model = model.get
253
-
254
- # refresh arguments
255
- arguments = measure.arguments(model)
256
-
257
- # set argument values to good values and run the measure on specific space type
258
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
259
-
260
- count = -1
261
-
262
- space_type = arguments[count += 1].clone
263
- assert(space_type.setValue('Multiple Lights Both LPD different schedules'))
264
- argument_map['space_type'] = space_type
265
-
266
- epd = arguments[count += 1].clone
267
- assert(epd.setValue(5.0))
268
- argument_map['epd'] = epd
269
-
270
- add_instance_all_spaces = arguments[count += 1].clone
271
- assert(add_instance_all_spaces.setValue(false))
272
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
273
-
274
- material_cost = arguments[count += 1].clone
275
- assert(material_cost.setValue(5.0))
276
- argument_map['material_cost'] = material_cost
277
-
278
- demolition_cost = arguments[count += 1].clone
279
- assert(demolition_cost.setValue(1.0))
280
- argument_map['demolition_cost'] = demolition_cost
281
-
282
- years_until_costs_start = arguments[count += 1].clone
283
- assert(years_until_costs_start.setValue(0))
284
- argument_map['years_until_costs_start'] = years_until_costs_start
285
-
286
- demo_cost_initial_const = arguments[count += 1].clone
287
- assert(demo_cost_initial_const.setValue(false))
288
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
289
-
290
- expected_life = arguments[count += 1].clone
291
- assert(expected_life.setValue(20))
292
- argument_map['expected_life'] = expected_life
293
-
294
- om_cost = arguments[count += 1].clone
295
- assert(om_cost.setValue(0.25))
296
- argument_map['om_cost'] = om_cost
297
-
298
- om_frequency = arguments[count += 1].clone
299
- assert(om_frequency.setValue(1))
300
- argument_map['om_frequency'] = om_frequency
301
-
302
- measure.run(model, runner, argument_map)
303
- result = runner.result
304
- show_output(result)
305
- assert(result.value.valueName == 'Success')
306
- # assert(result.warnings.size == 1)
307
- end
308
-
309
- def test_SetElectricEquipmentLoadsByEPD_e_DemoInitialConstruction_UnCosted_Baseline
310
- # create an instance of the measure
311
- measure = SetElectricEquipmentLoadsByEPD.new
312
- # create an instance of a runner
313
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
314
-
315
- # re-load the test model
316
- translator = OpenStudio::OSVersion::VersionTranslator.new
317
- path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm')
318
- model = translator.loadModel(path)
319
- assert(!model.empty?)
320
- model = model.get
321
-
322
- # refresh arguments
323
- arguments = measure.arguments(model)
324
-
325
- # set argument values to good values and run the measure on specific space type
326
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
327
-
328
- count = -1
329
-
330
- space_type = arguments[count += 1].clone
331
- assert(space_type.setValue('Multiple Lights Both LPD different schedules'))
332
- argument_map['space_type'] = space_type
333
-
334
- epd = arguments[count += 1].clone
335
- assert(epd.setValue(5.0))
336
- argument_map['epd'] = epd
337
-
338
- add_instance_all_spaces = arguments[count += 1].clone
339
- assert(add_instance_all_spaces.setValue(false))
340
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
341
-
342
- material_cost = arguments[count += 1].clone
343
- assert(material_cost.setValue(5.0))
344
- argument_map['material_cost'] = material_cost
345
-
346
- demolition_cost = arguments[count += 1].clone
347
- assert(demolition_cost.setValue(1.0))
348
- argument_map['demolition_cost'] = demolition_cost
349
-
350
- years_until_costs_start = arguments[count += 1].clone
351
- assert(years_until_costs_start.setValue(0))
352
- argument_map['years_until_costs_start'] = years_until_costs_start
353
-
354
- demo_cost_initial_const = arguments[count += 1].clone
355
- assert(demo_cost_initial_const.setValue(true))
356
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
357
-
358
- expected_life = arguments[count += 1].clone
359
- assert(expected_life.setValue(20))
360
- argument_map['expected_life'] = expected_life
361
-
362
- om_cost = arguments[count += 1].clone
363
- assert(om_cost.setValue(0.25))
364
- argument_map['om_cost'] = om_cost
365
-
366
- om_frequency = arguments[count += 1].clone
367
- assert(om_frequency.setValue(1))
368
- argument_map['om_frequency'] = om_frequency
369
-
370
- measure.run(model, runner, argument_map)
371
- result = runner.result
372
- show_output(result)
373
- assert(result.value.valueName == 'Success')
374
- # assert(result.warnings.size == 1)
375
- end
376
-
377
- def test_SetElectricEquipmentLoadsByEPD_f_DemoInitialConstruction_Costed_Baseline
378
- # create an instance of the measure
379
- measure = SetElectricEquipmentLoadsByEPD.new
380
- # create an instance of a runner
381
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
382
-
383
- # re-load the test model
384
- translator = OpenStudio::OSVersion::VersionTranslator.new
385
- path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01_Costed.osm')
386
- model = translator.loadModel(path)
387
- assert(!model.empty?)
388
- model = model.get
389
-
390
- # refresh arguments
391
- arguments = measure.arguments(model)
392
-
393
- # set argument values to good values and run the measure on specific space type
394
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
395
-
396
- count = -1
397
-
398
- space_type = arguments[count += 1].clone
399
- assert(space_type.setValue('Multiple Lights Both LPD different schedules'))
400
- argument_map['space_type'] = space_type
401
-
402
- epd = arguments[count += 1].clone
403
- assert(epd.setValue(5.0))
404
- argument_map['epd'] = epd
405
-
406
- add_instance_all_spaces = arguments[count += 1].clone
407
- assert(add_instance_all_spaces.setValue(false))
408
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
409
-
410
- material_cost = arguments[count += 1].clone
411
- assert(material_cost.setValue(5.0))
412
- argument_map['material_cost'] = material_cost
413
-
414
- demolition_cost = arguments[count += 1].clone
415
- assert(demolition_cost.setValue(1.0))
416
- argument_map['demolition_cost'] = demolition_cost
417
-
418
- years_until_costs_start = arguments[count += 1].clone
419
- assert(years_until_costs_start.setValue(0))
420
- argument_map['years_until_costs_start'] = years_until_costs_start
421
-
422
- demo_cost_initial_const = arguments[count += 1].clone
423
- assert(demo_cost_initial_const.setValue(true))
424
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
425
-
426
- expected_life = arguments[count += 1].clone
427
- assert(expected_life.setValue(20))
428
- argument_map['expected_life'] = expected_life
429
-
430
- om_cost = arguments[count += 1].clone
431
- assert(om_cost.setValue(0.25))
432
- argument_map['om_cost'] = om_cost
433
-
434
- om_frequency = arguments[count += 1].clone
435
- assert(om_frequency.setValue(1))
436
- argument_map['om_frequency'] = om_frequency
437
-
438
- measure.run(model, runner, argument_map)
439
- result = runner.result
440
- show_output(result)
441
- assert(result.value.valueName == 'Success')
442
- # assert(result.warnings.size == 1)
443
- end
444
-
445
- def test_SetElectricEquipmentLoadsByEPD_no_lights
446
- # create an instance of the measure
447
- measure = SetElectricEquipmentLoadsByEPD.new
448
-
449
- # create an instance of a runner
450
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
451
-
452
- # load the test model
453
- translator = OpenStudio::OSVersion::VersionTranslator.new
454
- path = OpenStudio::Path.new(File.dirname(__FILE__) + '/EnvelopeAndLoadTestModel_01.osm')
455
- model = translator.loadModel(path)
456
- assert(!model.empty?)
457
- model = model.get
458
-
459
- model.getSpaceTypes.each do |space_type|
460
- puts space_type.name
461
- next if space_type.name.to_s != 'Single Light EPD'
462
- space_type.lights.each(&:remove)
463
- end
464
-
465
- # get arguments and test that they are what we are expecting
466
- arguments = measure.arguments(model)
467
- assert_equal(10, arguments.size)
468
- assert_equal('space_type', arguments[0].name)
469
- assert_equal('epd', arguments[1].name)
470
- assert_equal(1.0, arguments[1].defaultValueAsDouble)
471
-
472
- # set argument values to bad values and run the measure
473
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
474
-
475
- count = -1
476
-
477
- space_type = arguments[count += 1].clone
478
- assert(space_type.setValue('*Entire Building*'))
479
- argument_map['space_type'] = space_type
480
-
481
- epd = arguments[count += 1].clone
482
- assert(epd.setValue(3.0))
483
- argument_map['epd'] = epd
484
-
485
- add_instance_all_spaces = arguments[count += 1].clone
486
- assert(add_instance_all_spaces.setValue(false))
487
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
488
-
489
- material_cost = arguments[count += 1].clone
490
- assert(material_cost.setValue(5.0))
491
- argument_map['material_cost'] = material_cost
492
-
493
- demolition_cost = arguments[count += 1].clone
494
- assert(demolition_cost.setValue(1.0))
495
- argument_map['demolition_cost'] = demolition_cost
496
-
497
- years_until_costs_start = arguments[count += 1].clone
498
- assert(years_until_costs_start.setValue(0))
499
- argument_map['years_until_costs_start'] = years_until_costs_start
500
-
501
- demo_cost_initial_const = arguments[count += 1].clone
502
- assert(demo_cost_initial_const.setValue(false))
503
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
504
-
505
- expected_life = arguments[count += 1].clone
506
- assert(expected_life.setValue(20))
507
- argument_map['expected_life'] = expected_life
508
-
509
- om_cost = arguments[count += 1].clone
510
- assert(om_cost.setValue(0.25))
511
- argument_map['om_cost'] = om_cost
512
-
513
- om_frequency = arguments[count += 1].clone
514
- assert(om_frequency.setValue(1))
515
- argument_map['om_frequency'] = om_frequency
516
-
517
- measure.run(model, runner, argument_map)
518
- result = runner.result
519
- show_output(result)
520
- assert(result.value.valueName == 'Success')
521
- end
522
-
523
- def test_SetElectricEquipmentLoadsByEPD_space_wo_light
524
- skip # test model is 2.7.0 but CI is only 2.6.x
525
-
526
- # create an instance of the measure
527
- measure = SetElectricEquipmentLoadsByEPD.new
528
- # create an instance of a runner
529
- runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
530
-
531
- # load the test model
532
- translator = OpenStudio::OSVersion::VersionTranslator.new
533
- path = OpenStudio::Path.new(File.dirname(__FILE__) + '/HasSpaceWithNoLightsOrElec.osm')
534
- model = translator.loadModel(path)
535
- assert(!model.empty?)
536
- model = model.get
537
-
538
- # refresh arguments
539
- arguments = measure.arguments(model)
540
-
541
- # set argument values to good values and run the measure on entire model with spaces
542
- argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
543
-
544
- count = -1
545
-
546
- space_type = arguments[count += 1].clone
547
- assert(space_type.setValue('*Entire Building*'))
548
- argument_map['space_type'] = space_type
549
-
550
- epd = arguments[count += 1].clone
551
- assert(epd.setValue(5.0))
552
- argument_map['epd'] = epd
553
-
554
- add_instance_all_spaces = arguments[count += 1].clone
555
- assert(add_instance_all_spaces.setValue(true))
556
- argument_map['add_instance_all_spaces'] = add_instance_all_spaces
557
-
558
- material_cost = arguments[count += 1].clone
559
- assert(material_cost.setValue(5.0))
560
- argument_map['material_cost'] = material_cost
561
-
562
- demolition_cost = arguments[count += 1].clone
563
- assert(demolition_cost.setValue(1.0))
564
- argument_map['demolition_cost'] = demolition_cost
565
-
566
- years_until_costs_start = arguments[count += 1].clone
567
- assert(years_until_costs_start.setValue(0))
568
- argument_map['years_until_costs_start'] = years_until_costs_start
569
-
570
- demo_cost_initial_const = arguments[count += 1].clone
571
- assert(demo_cost_initial_const.setValue(false))
572
- argument_map['demo_cost_initial_const'] = demo_cost_initial_const
573
-
574
- expected_life = arguments[count += 1].clone
575
- assert(expected_life.setValue(20))
576
- argument_map['expected_life'] = expected_life
577
-
578
- om_cost = arguments[count += 1].clone
579
- assert(om_cost.setValue(0.25))
580
- argument_map['om_cost'] = om_cost
581
-
582
- om_frequency = arguments[count += 1].clone
583
- assert(om_frequency.setValue(1))
584
- argument_map['om_frequency'] = om_frequency
585
-
586
- measure.run(model, runner, argument_map)
587
- result = runner.result
588
- show_output(result)
589
- assert(result.value.valueName == 'Success')
590
- # assert(result.warnings.size == 2)
591
- end
592
- end