honeybee-openstudio 0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.coveralls.yml +1 -0
- data/.gitignore +32 -33
- data/.releaserc.json +7 -7
- data/.travis.yml +41 -0
- data/Gemfile +18 -14
- data/LICENSE.md +23 -23
- data/README.md +95 -95
- data/Rakefile +21 -16
- data/doc_templates/LICENSE.md +23 -23
- data/doc_templates/copyright_erb.txt +31 -31
- data/doc_templates/copyright_js.txt +4 -4
- data/doc_templates/copyright_ruby.txt +29 -29
- data/honeybee-openstudio.gemspec +35 -38
- data/lib/files/Honeybee.rb +112 -112
- data/lib/files/honeybee_workflow.osw +47 -47
- data/lib/files/urbanopt_Gemfile +32 -32
- data/lib/{honeybee/_defaults → from_honeybee/_openapi}/model.json +8126 -11310
- data/lib/{honeybee/_defaults → from_honeybee/_openapi}/simulation-parameter.json +842 -972
- data/lib/{to_openstudio → from_honeybee}/construction/air.rb +65 -56
- data/lib/{to_openstudio → from_honeybee}/construction/opaque.rb +77 -67
- data/lib/{to_openstudio → from_honeybee}/construction/shade.rb +108 -99
- data/lib/{to_openstudio → from_honeybee}/construction/window.rb +80 -70
- data/lib/{to_openstudio → from_honeybee}/construction_set.rb +278 -266
- data/lib/{honeybee → from_honeybee}/extension.rb +109 -129
- data/lib/{to_openstudio → from_honeybee}/geometry/aperture.rb +167 -157
- data/lib/{to_openstudio → from_honeybee}/geometry/door.rb +160 -150
- data/lib/{to_openstudio → from_honeybee}/geometry/face.rb +163 -178
- data/lib/{to_openstudio → from_honeybee}/geometry/room.rb +392 -442
- data/lib/{to_openstudio → from_honeybee}/geometry/shade.rb +89 -79
- data/lib/{to_openstudio → from_honeybee}/hvac/ideal_air.rb +150 -141
- data/lib/{to_openstudio → from_honeybee}/load/electric_equipment.rb +96 -87
- data/lib/{to_openstudio → from_honeybee}/load/gas_equipment.rb +97 -88
- data/lib/{to_openstudio → from_honeybee}/load/infiltration.rb +94 -85
- data/lib/{to_openstudio → from_honeybee}/load/lighting.rb +98 -89
- data/lib/{to_openstudio → from_honeybee}/load/people.rb +100 -91
- data/lib/{to_openstudio → from_honeybee}/load/setpoint_humidistat.rb +75 -66
- data/lib/{to_openstudio → from_honeybee}/load/setpoint_thermostat.rb +71 -62
- data/lib/{to_openstudio → from_honeybee}/load/ventilation.rb +96 -87
- data/lib/{to_openstudio → from_honeybee}/material/opaque.rb +94 -85
- data/lib/{to_openstudio → from_honeybee}/material/opaque_no_mass.rb +94 -85
- data/lib/{to_openstudio → from_honeybee}/material/window_blind.rb +238 -229
- data/lib/{to_openstudio → from_honeybee}/material/window_gas.rb +76 -67
- data/lib/{to_openstudio → from_honeybee}/material/window_gas_custom.rb +118 -108
- data/lib/{to_openstudio → from_honeybee}/material/window_gas_mixture.rb +79 -70
- data/lib/{to_openstudio → from_honeybee}/material/window_glazing.rb +166 -157
- data/lib/{to_openstudio → from_honeybee}/material/window_shade.rb +160 -151
- data/lib/{to_openstudio → from_honeybee}/material/window_simpleglazsys.rb +73 -64
- data/lib/from_honeybee/model.rb +434 -0
- data/lib/{honeybee → from_honeybee}/model_object.rb +110 -108
- data/lib/{to_openstudio → from_honeybee}/program_type.rb +124 -104
- data/lib/{to_openstudio → from_honeybee}/schedule/fixed_interval.rb +115 -105
- data/lib/{to_openstudio → from_honeybee}/schedule/ruleset.rb +164 -164
- data/lib/{to_openstudio → from_honeybee}/schedule/type_limit.rb +88 -76
- data/lib/{to_openstudio/simulation/design_day.rb → from_honeybee/simulation/designday.rb} +105 -96
- data/lib/{honeybee/load/lighting.rb → from_honeybee/simulation/extension.rb} +46 -43
- data/lib/{to_openstudio/simulation/parameter_model.rb → from_honeybee/simulation/parameter.rb} +277 -243
- data/lib/{honeybee/simulation/design_day.rb → from_honeybee/version.rb} +34 -42
- data/lib/{honeybee.rb → from_honeybee.rb} +86 -93
- data/lib/measures/from_honeybee_model/LICENSE.md +27 -23
- data/lib/measures/from_honeybee_model/README.md +32 -32
- data/lib/measures/from_honeybee_model/measure.rb +91 -91
- data/lib/measures/from_honeybee_model/measure.xml +103 -80
- data/lib/measures/from_honeybee_model/tests/from_honeybee_model_test.rb +126 -126
- data/lib/measures/from_honeybee_simulation_parameter/LICENSE.md +27 -23
- data/lib/measures/from_honeybee_simulation_parameter/README.md +32 -32
- data/lib/measures/from_honeybee_simulation_parameter/measure.rb +95 -95
- data/lib/measures/from_honeybee_simulation_parameter/measure.xml +91 -86
- data/lib/measures/from_honeybee_simulation_parameter/tests/from_honeybee_simulation_parameter_test.rb +109 -109
- metadata +89 -147
- data/.github/workflows/ci.yaml +0 -88
- data/doc_templates/README.md.erb +0 -42
- data/lib/from_openstudio/geometry/aperture.rb +0 -136
- data/lib/from_openstudio/geometry/door.rb +0 -136
- data/lib/from_openstudio/geometry/face.rb +0 -174
- data/lib/from_openstudio/geometry/room.rb +0 -121
- data/lib/from_openstudio/geometry/shade.rb +0 -87
- data/lib/from_openstudio/model.rb +0 -123
- data/lib/from_openstudio/model_object.rb +0 -43
- data/lib/from_openstudio/simulation/design_day.rb +0 -123
- data/lib/from_openstudio/simulation/parameter_model.rb +0 -93
- data/lib/from_openstudio/simulation/simulation_output.rb +0 -67
- data/lib/from_openstudio.rb +0 -49
- data/lib/honeybee/_defaults/energy_default.json +0 -1682
- data/lib/honeybee/construction/air.rb +0 -42
- data/lib/honeybee/construction/opaque.rb +0 -42
- data/lib/honeybee/construction/shade.rb +0 -42
- data/lib/honeybee/construction/window.rb +0 -51
- data/lib/honeybee/construction/windowshade.rb +0 -43
- data/lib/honeybee/construction_set.rb +0 -42
- data/lib/honeybee/geometry/aperture.rb +0 -42
- data/lib/honeybee/geometry/door.rb +0 -42
- data/lib/honeybee/geometry/face.rb +0 -48
- data/lib/honeybee/geometry/room.rb +0 -56
- data/lib/honeybee/geometry/shade.rb +0 -42
- data/lib/honeybee/hvac/ideal_air.rb +0 -42
- data/lib/honeybee/hvac/template.rb +0 -73
- data/lib/honeybee/load/electric_equipment.rb +0 -42
- data/lib/honeybee/load/gas_equipment.rb +0 -42
- data/lib/honeybee/load/infiltration.rb +0 -42
- data/lib/honeybee/load/people.rb +0 -42
- data/lib/honeybee/load/setpoint_humidistat.rb +0 -46
- data/lib/honeybee/load/setpoint_thermostat.rb +0 -46
- data/lib/honeybee/load/ventilation.rb +0 -42
- data/lib/honeybee/material/opaque.rb +0 -42
- data/lib/honeybee/material/opaque_no_mass.rb +0 -42
- data/lib/honeybee/material/window_blind.rb +0 -42
- data/lib/honeybee/material/window_gas.rb +0 -42
- data/lib/honeybee/material/window_gas_custom.rb +0 -42
- data/lib/honeybee/material/window_gas_mixture.rb +0 -42
- data/lib/honeybee/material/window_glazing.rb +0 -42
- data/lib/honeybee/material/window_shade.rb +0 -42
- data/lib/honeybee/material/window_simpleglazsys.rb +0 -42
- data/lib/honeybee/model.rb +0 -87
- data/lib/honeybee/program_type.rb +0 -56
- data/lib/honeybee/schedule/fixed_interval.rb +0 -42
- data/lib/honeybee/schedule/ruleset.rb +0 -42
- data/lib/honeybee/schedule/type_limit.rb +0 -42
- data/lib/honeybee/simulation/parameter_model.rb +0 -86
- data/lib/honeybee/simulation/simulation_output.rb +0 -42
- data/lib/honeybee/ventcool/control.rb +0 -42
- data/lib/honeybee/ventcool/opening.rb +0 -46
- data/lib/honeybee/ventcool/simulation.rb +0 -42
- data/lib/to_openstudio/construction/windowshade.rb +0 -196
- data/lib/to_openstudio/hvac/Model.hvac.rb +0 -641
- data/lib/to_openstudio/hvac/template.rb +0 -169
- data/lib/to_openstudio/model.rb +0 -497
- data/lib/to_openstudio/model_object.rb +0 -52
- data/lib/to_openstudio/ventcool/control.rb +0 -185
- data/lib/to_openstudio/ventcool/opening.rb +0 -189
- data/lib/to_openstudio/ventcool/simulation.rb +0 -101
- data/lib/to_openstudio.rb +0 -92
@@ -1,93 +1,86 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
-
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
-
#
|
5
|
-
# Redistribution and use in source and binary forms, with or without
|
6
|
-
# modification, are permitted provided that the following conditions are met:
|
7
|
-
#
|
8
|
-
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
-
# this list of conditions and the following disclaimer.
|
10
|
-
#
|
11
|
-
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
-
# this list of conditions and the following disclaimer in the documentation
|
13
|
-
# and/or other materials provided with the distribution.
|
14
|
-
#
|
15
|
-
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
-
# may be used to endorse or promote products derived from this software without
|
17
|
-
# specific prior written permission from the respective party.
|
18
|
-
#
|
19
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
-
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
-
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
-
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
-
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
-
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
-
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
-
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
-
# *******************************************************************************
|
31
|
-
|
32
|
-
# import the core objects from which everything inherits
|
33
|
-
require '
|
34
|
-
require '
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
require '
|
39
|
-
require '
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
require '
|
44
|
-
require '
|
45
|
-
require '
|
46
|
-
require '
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
require '
|
51
|
-
|
52
|
-
# import the construction objects
|
53
|
-
require '
|
54
|
-
require '
|
55
|
-
require '
|
56
|
-
require '
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
require '
|
61
|
-
require '
|
62
|
-
require '
|
63
|
-
require '
|
64
|
-
require '
|
65
|
-
require '
|
66
|
-
require '
|
67
|
-
require '
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
require '
|
72
|
-
require '
|
73
|
-
require '
|
74
|
-
require '
|
75
|
-
require '
|
76
|
-
require '
|
77
|
-
require '
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
require '
|
82
|
-
require '
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
require '
|
87
|
-
require 'honeybee/ventcool/opening'
|
88
|
-
require 'honeybee/ventcool/simulation'
|
89
|
-
|
90
|
-
# import the simulation objects
|
91
|
-
require 'honeybee/simulation/design_day'
|
92
|
-
require 'honeybee/simulation/parameter_model'
|
93
|
-
require 'honeybee/simulation/simulation_output'
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
# import the core objects from which everything inherits
|
33
|
+
require 'from_honeybee/version'
|
34
|
+
require 'from_honeybee/extension'
|
35
|
+
require 'from_honeybee/model_object'
|
36
|
+
|
37
|
+
# import the compound objects that house the other objects
|
38
|
+
require 'from_honeybee/model'
|
39
|
+
require 'from_honeybee/construction_set'
|
40
|
+
require 'from_honeybee/program_type'
|
41
|
+
|
42
|
+
# import the geometry objects
|
43
|
+
require 'from_honeybee/geometry/shade'
|
44
|
+
require 'from_honeybee/geometry/door'
|
45
|
+
require 'from_honeybee/geometry/aperture'
|
46
|
+
require 'from_honeybee/geometry/face'
|
47
|
+
require 'from_honeybee/geometry/room'
|
48
|
+
|
49
|
+
# import the HVAC objects
|
50
|
+
require 'from_honeybee/hvac/ideal_air'
|
51
|
+
|
52
|
+
# import the construction objects
|
53
|
+
require 'from_honeybee/construction/opaque'
|
54
|
+
require 'from_honeybee/construction/window'
|
55
|
+
require 'from_honeybee/construction/shade'
|
56
|
+
require 'from_honeybee/construction/air'
|
57
|
+
|
58
|
+
# import the material objects
|
59
|
+
require 'from_honeybee/material/opaque'
|
60
|
+
require 'from_honeybee/material/opaque_no_mass'
|
61
|
+
require 'from_honeybee/material/window_gas'
|
62
|
+
require 'from_honeybee/material/window_gas_mixture'
|
63
|
+
require 'from_honeybee/material/window_gas_custom'
|
64
|
+
require 'from_honeybee/material/window_blind'
|
65
|
+
require 'from_honeybee/material/window_glazing'
|
66
|
+
require 'from_honeybee/material/window_shade'
|
67
|
+
require 'from_honeybee/material/window_simpleglazsys'
|
68
|
+
|
69
|
+
# import the load objects
|
70
|
+
require 'from_honeybee/load/people'
|
71
|
+
require 'from_honeybee/load/lighting'
|
72
|
+
require 'from_honeybee/load/electric_equipment'
|
73
|
+
require 'from_honeybee/load/gas_equipment'
|
74
|
+
require 'from_honeybee/load/infiltration'
|
75
|
+
require 'from_honeybee/load/ventilation'
|
76
|
+
require 'from_honeybee/load/setpoint_thermostat'
|
77
|
+
require 'from_honeybee/load/setpoint_humidistat'
|
78
|
+
|
79
|
+
# import the schedule objects
|
80
|
+
require 'from_honeybee/schedule/type_limit'
|
81
|
+
require 'from_honeybee/schedule/fixed_interval'
|
82
|
+
require 'from_honeybee/schedule/ruleset'
|
83
|
+
|
84
|
+
# import the simulation objects
|
85
|
+
require 'from_honeybee/simulation/extension'
|
86
|
+
require 'from_honeybee/simulation/parameter'
|
@@ -1,23 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
1
|
+
OpenStudio(R), Copyright (c) 2008-2018, Alliance for Sustainable Energy, LLC. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
4
|
+
provided that the following conditions are met:
|
5
|
+
|
6
|
+
(1) Redistributions of source code must retain the above copyright notice, this list of conditions
|
7
|
+
and the following disclaimer.
|
8
|
+
|
9
|
+
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
10
|
+
and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
|
13
|
+
or promote products derived from this software without specific prior written permission from the
|
14
|
+
respective party.
|
15
|
+
|
16
|
+
(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
|
17
|
+
derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
|
18
|
+
designation without specific prior written permission from Alliance for Sustainable Energy, LLC.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
|
21
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
22
|
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
|
23
|
+
OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
25
|
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
26
|
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
27
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -1,32 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
###### (Automatically generated documentation)
|
4
|
-
|
5
|
-
# From Energy Model
|
6
|
-
|
7
|
-
## Description
|
8
|
-
Translate a JSON file of a Honeybee Model into an OpenStudio Model.
|
9
|
-
|
10
|
-
## Modeler Description
|
11
|
-
Translate a JSON file of a Honeybee Model into an OpenStudio Model.
|
12
|
-
|
13
|
-
## Measure Type
|
14
|
-
ModelMeasure
|
15
|
-
|
16
|
-
## Taxonomy
|
17
|
-
|
18
|
-
|
19
|
-
## Arguments
|
20
|
-
|
21
|
-
|
22
|
-
### Path to the Honeybee Model JSON file
|
23
|
-
|
24
|
-
**Name:** model_json,
|
25
|
-
**Type:** String,
|
26
|
-
**Units:** ,
|
27
|
-
**Required:** true,
|
28
|
-
**Model Dependent:** false
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
|
2
|
+
|
3
|
+
###### (Automatically generated documentation)
|
4
|
+
|
5
|
+
# From Energy Model
|
6
|
+
|
7
|
+
## Description
|
8
|
+
Translate a JSON file of a Honeybee Model into an OpenStudio Model.
|
9
|
+
|
10
|
+
## Modeler Description
|
11
|
+
Translate a JSON file of a Honeybee Model into an OpenStudio Model.
|
12
|
+
|
13
|
+
## Measure Type
|
14
|
+
ModelMeasure
|
15
|
+
|
16
|
+
## Taxonomy
|
17
|
+
|
18
|
+
|
19
|
+
## Arguments
|
20
|
+
|
21
|
+
|
22
|
+
### Path to the Honeybee Model JSON file
|
23
|
+
|
24
|
+
**Name:** model_json,
|
25
|
+
**Type:** String,
|
26
|
+
**Units:** ,
|
27
|
+
**Required:** true,
|
28
|
+
**Model Dependent:** false
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
|
@@ -1,91 +1,91 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
-
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
-
#
|
5
|
-
# Redistribution and use in source and binary forms, with or without
|
6
|
-
# modification, are permitted provided that the following conditions are met:
|
7
|
-
#
|
8
|
-
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
-
# this list of conditions and the following disclaimer.
|
10
|
-
#
|
11
|
-
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
-
# this list of conditions and the following disclaimer in the documentation
|
13
|
-
# and/or other materials provided with the distribution.
|
14
|
-
#
|
15
|
-
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
-
# may be used to endorse or promote products derived from this software without
|
17
|
-
# specific prior written permission from the respective party.
|
18
|
-
#
|
19
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
-
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
-
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
-
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
-
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
-
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
-
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
-
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
-
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
-
# *******************************************************************************
|
31
|
-
|
32
|
-
# see the URL below for information on how to write OpenStudio measures
|
33
|
-
# http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/
|
34
|
-
|
35
|
-
require '
|
36
|
-
|
37
|
-
# start the measure
|
38
|
-
class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
39
|
-
# human readable name
|
40
|
-
def name
|
41
|
-
return 'From Honeybee Model'
|
42
|
-
end
|
43
|
-
|
44
|
-
# human readable description
|
45
|
-
def description
|
46
|
-
return 'Translate a JSON file of a Honeybee Model into an OpenStudio Model.'
|
47
|
-
end
|
48
|
-
|
49
|
-
# human readable description of modeling approach
|
50
|
-
def modeler_description
|
51
|
-
return 'Translate a JSON file of a Honeybee Model into an OpenStudio Model.'
|
52
|
-
end
|
53
|
-
|
54
|
-
# define the arguments that the user will input
|
55
|
-
def arguments(model)
|
56
|
-
args = OpenStudio::Measure::OSArgumentVector.new
|
57
|
-
|
58
|
-
# Make an argument for the honyebee model json
|
59
|
-
model_json = OpenStudio::Measure::OSArgument.makeStringArgument('model_json', true)
|
60
|
-
model_json.setDisplayName('Path to the Honeybee Model JSON file')
|
61
|
-
args << model_json
|
62
|
-
|
63
|
-
return args
|
64
|
-
end
|
65
|
-
|
66
|
-
# define what happens when the measure is run
|
67
|
-
def run(model, runner, user_arguments)
|
68
|
-
super(model, runner, user_arguments)
|
69
|
-
STDOUT.flush
|
70
|
-
if !runner.validateUserArguments(arguments(model), user_arguments)
|
71
|
-
return false
|
72
|
-
end
|
73
|
-
|
74
|
-
model_json = runner.getStringArgumentValue('model_json', user_arguments)
|
75
|
-
|
76
|
-
if !File.exist?(model_json)
|
77
|
-
runner.registerError("Cannot find file '#{model_json}'")
|
78
|
-
return false
|
79
|
-
end
|
80
|
-
|
81
|
-
honeybee_model =
|
82
|
-
|
83
|
-
STDOUT.flush
|
84
|
-
honeybee_model.to_openstudio_model(model)
|
85
|
-
STDOUT.flush
|
86
|
-
return true
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# register the measure to be used by the application
|
91
|
-
FromHoneybeeModel.new.registerWithApplication
|
1
|
+
# *******************************************************************************
|
2
|
+
# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
|
3
|
+
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
|
4
|
+
#
|
5
|
+
# Redistribution and use in source and binary forms, with or without
|
6
|
+
# modification, are permitted provided that the following conditions are met:
|
7
|
+
#
|
8
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
9
|
+
# this list of conditions and the following disclaimer.
|
10
|
+
#
|
11
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
12
|
+
# this list of conditions and the following disclaimer in the documentation
|
13
|
+
# and/or other materials provided with the distribution.
|
14
|
+
#
|
15
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
16
|
+
# may be used to endorse or promote products derived from this software without
|
17
|
+
# specific prior written permission from the respective party.
|
18
|
+
#
|
19
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
20
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
21
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
23
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
24
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
26
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
28
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
29
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
# *******************************************************************************
|
31
|
+
|
32
|
+
# see the URL below for information on how to write OpenStudio measures
|
33
|
+
# http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/
|
34
|
+
|
35
|
+
require 'from_honeybee/model'
|
36
|
+
|
37
|
+
# start the measure
|
38
|
+
class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
39
|
+
# human readable name
|
40
|
+
def name
|
41
|
+
return 'From Honeybee Model'
|
42
|
+
end
|
43
|
+
|
44
|
+
# human readable description
|
45
|
+
def description
|
46
|
+
return 'Translate a JSON file of a Honeybee Model into an OpenStudio Model.'
|
47
|
+
end
|
48
|
+
|
49
|
+
# human readable description of modeling approach
|
50
|
+
def modeler_description
|
51
|
+
return 'Translate a JSON file of a Honeybee Model into an OpenStudio Model.'
|
52
|
+
end
|
53
|
+
|
54
|
+
# define the arguments that the user will input
|
55
|
+
def arguments(model)
|
56
|
+
args = OpenStudio::Measure::OSArgumentVector.new
|
57
|
+
|
58
|
+
# Make an argument for the honyebee model json
|
59
|
+
model_json = OpenStudio::Measure::OSArgument.makeStringArgument('model_json', true)
|
60
|
+
model_json.setDisplayName('Path to the Honeybee Model JSON file')
|
61
|
+
args << model_json
|
62
|
+
|
63
|
+
return args
|
64
|
+
end
|
65
|
+
|
66
|
+
# define what happens when the measure is run
|
67
|
+
def run(model, runner, user_arguments)
|
68
|
+
super(model, runner, user_arguments)
|
69
|
+
STDOUT.flush
|
70
|
+
if !runner.validateUserArguments(arguments(model), user_arguments)
|
71
|
+
return false
|
72
|
+
end
|
73
|
+
|
74
|
+
model_json = runner.getStringArgumentValue('model_json', user_arguments)
|
75
|
+
|
76
|
+
if !File.exist?(model_json)
|
77
|
+
runner.registerError("Cannot find file '#{model_json}'")
|
78
|
+
return false
|
79
|
+
end
|
80
|
+
|
81
|
+
honeybee_model = FromHoneybee::Model.read_from_disk(model_json)
|
82
|
+
|
83
|
+
STDOUT.flush
|
84
|
+
honeybee_model.to_openstudio_model(model)
|
85
|
+
STDOUT.flush
|
86
|
+
return true
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# register the measure to be used by the application
|
91
|
+
FromHoneybeeModel.new.registerWithApplication
|