openstudio-load-flexibility-measures 0.2.1 → 0.4.0
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.
- checksums.yaml +4 -4
- data/.gitignore +36 -36
- data/.rubocop.yml +6 -9
- data/CHANGELOG.html +75 -75
- data/CHANGELOG.md +59 -37
- data/Gemfile +31 -7
- data/Jenkinsfile +11 -0
- data/README.md +53 -42
- data/Rakefile +15 -15
- data/doc_templates/LICENSE.md +26 -26
- data/doc_templates/README.md.erb +41 -41
- data/doc_templates/copyright_erb.txt +35 -35
- data/doc_templates/copyright_js.txt +3 -3
- data/doc_templates/copyright_ruby.txt +33 -33
- data/lib/measures/add_central_ice_storage/LICENSE.md +26 -26
- data/lib/measures/add_central_ice_storage/README.md +264 -264
- data/lib/measures/add_central_ice_storage/README.md.erb +41 -41
- data/lib/measures/add_central_ice_storage/measure.rb +1325 -1324
- data/lib/measures/add_central_ice_storage/measure.xml +503 -503
- data/lib/measures/add_central_ice_storage/resources/OsLib_Schedules.rb +171 -173
- data/lib/measures/add_central_ice_storage/tests/add_central_ice_storage_test.rb +203 -203
- data/lib/measures/add_central_ice_storage/tests/ice_test_model.osm +21523 -21523
- data/lib/measures/add_hpwh/LICENSE.md +26 -26
- data/lib/measures/add_hpwh/README.md +186 -186
- data/lib/measures/add_hpwh/README.md.erb +41 -41
- data/lib/measures/add_hpwh/docs/Flexible Domestic Hot Water Implementation Guide.pdf +0 -0
- data/lib/measures/add_hpwh/measure.rb +663 -647
- data/lib/measures/add_hpwh/measure.xml +402 -397
- data/lib/measures/add_hpwh/tests/SmallHotel-2A.osm +42893 -42893
- data/lib/measures/add_hpwh/tests/{add_hphw_test.rb → add_hpwh_test.rb} +137 -98
- data/lib/measures/add_packaged_ice_storage/LICENSE.md +26 -26
- data/lib/measures/add_packaged_ice_storage/README.html +185 -185
- data/lib/measures/add_packaged_ice_storage/README.md +189 -189
- data/lib/measures/add_packaged_ice_storage/measure.rb +694 -691
- data/lib/measures/add_packaged_ice_storage/measure.xml +245 -245
- data/lib/measures/add_packaged_ice_storage/resources/TESCurves.idf +1059 -1059
- data/lib/measures/add_packaged_ice_storage/tests/MeasureTest.osm +9507 -9507
- data/lib/measures/add_packaged_ice_storage/tests/add_packaged_ice_storage_test.rb +96 -96
- data/lib/openstudio/load_flexibility_measures/version.rb +40 -40
- data/lib/openstudio/load_flexibility_measures.rb +50 -50
- data/openstudio-load-flexibility-measures.gemspec +33 -32
- metadata +27 -27
@@ -1,98 +1,137 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
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
|
-
# insert your copyright here
|
37
|
-
|
38
|
-
require 'openstudio'
|
39
|
-
require 'openstudio/measure/ShowRunnerOutput'
|
40
|
-
require 'minitest/autorun'
|
41
|
-
require_relative '../measure
|
42
|
-
require 'fileutils'
|
43
|
-
|
44
|
-
class
|
45
|
-
# def setup
|
46
|
-
# end
|
47
|
-
|
48
|
-
# def teardown
|
49
|
-
# end
|
50
|
-
|
51
|
-
def test_good_argument_values
|
52
|
-
# create an instance of the measure
|
53
|
-
measure =
|
54
|
-
|
55
|
-
# create runner with empty OSW
|
56
|
-
osw = OpenStudio::WorkflowJSON.new
|
57
|
-
runner = OpenStudio::Measure::OSRunner.new(osw)
|
58
|
-
|
59
|
-
# load the test model
|
60
|
-
translator = OpenStudio::OSVersion::VersionTranslator.new
|
61
|
-
path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
|
62
|
-
model = translator.loadModel(path)
|
63
|
-
assert(!model.empty?)
|
64
|
-
model = model.get
|
65
|
-
|
66
|
-
# get arguments
|
67
|
-
arguments = measure.arguments(model)
|
68
|
-
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
69
|
-
|
70
|
-
# create hash of argument values.
|
71
|
-
# If the argument has a default that you want to use, you don't need it in the hash
|
72
|
-
args_hash = {}
|
73
|
-
# using defaults values from measure.rb for other arguments
|
74
|
-
|
75
|
-
# populate argument with specified hash value if specified
|
76
|
-
arguments.each do |arg|
|
77
|
-
temp_arg_var = arg.clone
|
78
|
-
if args_hash.key?(arg.name)
|
79
|
-
assert(temp_arg_var.setValue(args_hash[arg.name]))
|
80
|
-
end
|
81
|
-
argument_map[arg.name] = temp_arg_var
|
82
|
-
end
|
83
|
-
|
84
|
-
# run the measure
|
85
|
-
measure.run(model, runner, argument_map)
|
86
|
-
result = runner.result
|
87
|
-
|
88
|
-
# assert that it ran correctly
|
89
|
-
assert_equal('Success', result.value.valueName)
|
90
|
-
|
91
|
-
# show the output
|
92
|
-
show_output(result)
|
93
|
-
|
94
|
-
# save the model to test output directory
|
95
|
-
output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
|
96
|
-
model.save(output_file_path, true)
|
97
|
-
end
|
98
|
-
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2021, 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
|
+
# insert your copyright here
|
37
|
+
|
38
|
+
require 'openstudio'
|
39
|
+
require 'openstudio/measure/ShowRunnerOutput'
|
40
|
+
require 'minitest/autorun'
|
41
|
+
require_relative '../measure'
|
42
|
+
require 'fileutils'
|
43
|
+
|
44
|
+
class AddHpwhTest < Minitest::Test
|
45
|
+
# def setup
|
46
|
+
# end
|
47
|
+
|
48
|
+
# def teardown
|
49
|
+
# end
|
50
|
+
|
51
|
+
def test_good_argument_values
|
52
|
+
# create an instance of the measure
|
53
|
+
measure = AddHpwh.new
|
54
|
+
|
55
|
+
# create runner with empty OSW
|
56
|
+
osw = OpenStudio::WorkflowJSON.new
|
57
|
+
runner = OpenStudio::Measure::OSRunner.new(osw)
|
58
|
+
|
59
|
+
# load the test model
|
60
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
61
|
+
path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
|
62
|
+
model = translator.loadModel(path)
|
63
|
+
assert(!model.empty?)
|
64
|
+
model = model.get
|
65
|
+
|
66
|
+
# get arguments
|
67
|
+
arguments = measure.arguments(model)
|
68
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
69
|
+
|
70
|
+
# create hash of argument values.
|
71
|
+
# If the argument has a default that you want to use, you don't need it in the hash
|
72
|
+
args_hash = {}
|
73
|
+
# using defaults values from measure.rb for other arguments
|
74
|
+
|
75
|
+
# populate argument with specified hash value if specified
|
76
|
+
arguments.each do |arg|
|
77
|
+
temp_arg_var = arg.clone
|
78
|
+
if args_hash.key?(arg.name)
|
79
|
+
assert(temp_arg_var.setValue(args_hash[arg.name]))
|
80
|
+
end
|
81
|
+
argument_map[arg.name] = temp_arg_var
|
82
|
+
end
|
83
|
+
|
84
|
+
# run the measure
|
85
|
+
measure.run(model, runner, argument_map)
|
86
|
+
result = runner.result
|
87
|
+
|
88
|
+
# assert that it ran correctly
|
89
|
+
assert_equal('Success', result.value.valueName)
|
90
|
+
|
91
|
+
# show the output
|
92
|
+
show_output(result)
|
93
|
+
|
94
|
+
# save the model to test output directory
|
95
|
+
output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
|
96
|
+
model.save(output_file_path, true)
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_empty_model
|
100
|
+
# create an instance of the measure
|
101
|
+
measure = AddHpwh.new
|
102
|
+
|
103
|
+
# create runner with empty OSW
|
104
|
+
osw = OpenStudio::WorkflowJSON.new
|
105
|
+
runner = OpenStudio::Measure::OSRunner.new(osw)
|
106
|
+
|
107
|
+
# make an empty model
|
108
|
+
model = OpenStudio::Model::Model.new
|
109
|
+
|
110
|
+
# get arguments
|
111
|
+
arguments = measure.arguments(model)
|
112
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
113
|
+
|
114
|
+
# create hash of argument values
|
115
|
+
args_hash = {}
|
116
|
+
|
117
|
+
# populate argument with specified hash value if specified
|
118
|
+
arguments.each do |arg|
|
119
|
+
temp_arg_var = arg.clone
|
120
|
+
if args_hash.key?(arg.name)
|
121
|
+
assert(temp_arg_var.setValue(args_hash[arg.name]))
|
122
|
+
end
|
123
|
+
argument_map[arg.name] = temp_arg_var
|
124
|
+
end
|
125
|
+
|
126
|
+
# run the measure
|
127
|
+
measure.run(model, runner, argument_map)
|
128
|
+
result = runner.result
|
129
|
+
|
130
|
+
# show the output
|
131
|
+
show_output(result)
|
132
|
+
|
133
|
+
# assert that it failed
|
134
|
+
assert_equal('Fail', result.value.valueName)
|
135
|
+
assert(result.errors.size == 1)
|
136
|
+
end
|
137
|
+
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008-2020, 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
|
1
|
+
OpenStudio(R), Copyright (c) 2008-2020, 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
27
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|