urbanopt-reporting 0.3.3 → 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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/Rakefile +16 -6
  4. data/doc_templates/copyright_ruby.txt +17 -7
  5. data/lib/measures/default_feature_reports/measure.rb +121 -97
  6. data/lib/measures/default_feature_reports/measure.xml +11 -11
  7. data/lib/measures/export_modelica_loads/LICENSE.md +23 -23
  8. data/lib/measures/export_modelica_loads/measure.rb +93 -96
  9. data/lib/measures/export_modelica_loads/measure.xml +21 -21
  10. data/lib/measures/export_time_series_modelica/LICENSE.md +27 -1
  11. data/lib/measures/export_time_series_modelica/measure.rb +165 -163
  12. data/lib/measures/export_time_series_modelica/measure.xml +18 -18
  13. data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +40 -35
  14. data/lib/urbanopt/reporting.rb +16 -6
  15. data/lib/urbanopt/reporting/default_reports.rb +16 -6
  16. data/lib/urbanopt/reporting/default_reports/construction_cost.rb +16 -6
  17. data/lib/urbanopt/reporting/default_reports/date.rb +16 -6
  18. data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +16 -6
  19. data/lib/urbanopt/reporting/default_reports/end_use.rb +54 -23
  20. data/lib/urbanopt/reporting/default_reports/end_uses.rb +16 -6
  21. data/lib/urbanopt/reporting/default_reports/extension.rb +16 -6
  22. data/lib/urbanopt/reporting/default_reports/feature_report.rb +21 -7
  23. data/lib/urbanopt/reporting/default_reports/generator.rb +16 -6
  24. data/lib/urbanopt/reporting/default_reports/location.rb +16 -6
  25. data/lib/urbanopt/reporting/default_reports/logger.rb +16 -6
  26. data/lib/urbanopt/reporting/default_reports/power_distribution.rb +16 -6
  27. data/lib/urbanopt/reporting/default_reports/program.rb +17 -7
  28. data/lib/urbanopt/reporting/default_reports/reporting_period.rb +16 -6
  29. data/lib/urbanopt/reporting/default_reports/scenario_report.rb +25 -13
  30. data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +11 -10
  31. data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +4 -1
  32. data/lib/urbanopt/reporting/default_reports/solar_pv.rb +16 -6
  33. data/lib/urbanopt/reporting/default_reports/storage.rb +16 -6
  34. data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +16 -6
  35. data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +17 -7
  36. data/lib/urbanopt/reporting/default_reports/validator.rb +16 -6
  37. data/lib/urbanopt/reporting/default_reports/wind.rb +16 -6
  38. data/lib/urbanopt/reporting/derived_extension.rb +16 -6
  39. data/lib/urbanopt/reporting/version.rb +17 -7
  40. data/urbanopt-reporting-gem.gemspec +3 -3
  41. metadata +9 -9
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>export_time_series_loads_csv</name>
5
5
  <uid>9fcf6116-c2eb-43d6-93f0-e1bdd822f768</uid>
6
- <version_id>3a539fd4-3978-4d0f-bd25-a54905fc7306</version_id>
7
- <version_modified>20201212T061249Z</version_modified>
6
+ <version_id>61d25864-a1a9-4082-974c-d04057271848</version_id>
7
+ <version_modified>20210427T174739Z</version_modified>
8
8
  <xml_checksum>9BF1E6AC</xml_checksum>
9
9
  <class_name>ExportTimeSeriesLoadsCSV</class_name>
10
10
  <display_name>ExportTimeSeriesLoadsCSV</display_name>
@@ -72,12 +72,6 @@
72
72
  </attribute>
73
73
  </attributes>
74
74
  <files>
75
- <file>
76
- <filename>LICENSE.md</filename>
77
- <filetype>md</filetype>
78
- <usage_type>license</usage_type>
79
- <checksum>CD7F5672</checksum>
80
- </file>
81
75
  <file>
82
76
  <filename>README.md.erb</filename>
83
77
  <filetype>erb</filetype>
@@ -108,23 +102,35 @@
108
102
  <usage_type>test</usage_type>
109
103
  <checksum>15AD3659</checksum>
110
104
  </file>
105
+ <file>
106
+ <filename>README.md</filename>
107
+ <filetype>md</filetype>
108
+ <usage_type>readme</usage_type>
109
+ <checksum>08F470AC</checksum>
110
+ </file>
111
+ <file>
112
+ <filename>LICENSE.md</filename>
113
+ <filetype>md</filetype>
114
+ <usage_type>license</usage_type>
115
+ <checksum>BBD19F47</checksum>
116
+ </file>
111
117
  <file>
112
118
  <filename>os_lib_helper_methods.rb</filename>
113
119
  <filetype>rb</filetype>
114
120
  <usage_type>resource</usage_type>
115
- <checksum>5C26809A</checksum>
121
+ <checksum>94DD761F</checksum>
116
122
  </file>
117
123
  <file>
118
124
  <filename>export_time_series_modelica_test.rb</filename>
119
125
  <filetype>rb</filetype>
120
126
  <usage_type>test</usage_type>
121
- <checksum>B595A09A</checksum>
127
+ <checksum>6B6CFF0B</checksum>
122
128
  </file>
123
129
  <file>
124
130
  <filename>building_loads.csv</filename>
125
131
  <filetype>csv</filetype>
126
132
  <usage_type>test</usage_type>
127
- <checksum>1E8091B8</checksum>
133
+ <checksum>393EEB17</checksum>
128
134
  </file>
129
135
  <file>
130
136
  <version>
@@ -135,13 +141,7 @@
135
141
  <filename>measure.rb</filename>
136
142
  <filetype>rb</filetype>
137
143
  <usage_type>script</usage_type>
138
- <checksum>C172F942</checksum>
139
- </file>
140
- <file>
141
- <filename>README.md</filename>
142
- <filetype>md</filetype>
143
- <usage_type>readme</usage_type>
144
- <checksum>08F470AC</checksum>
144
+ <checksum>0FC4AA70</checksum>
145
145
  </file>
146
146
  </files>
147
147
  </measure>
@@ -1,37 +1,42 @@
1
- # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2019, 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
- # *******************************************************************************
1
+ # *********************************************************************************
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
+ # contributors. All rights reserved.
4
+
5
+ # Redistribution and use in source and binary forms, with or without modification,
6
+ # are permitted provided that the following conditions are met:
7
+
8
+ # Redistributions of source code must retain the above copyright notice, this list
9
+ # of conditions and the following disclaimer.
10
+
11
+ # Redistributions in binary form must reproduce the above copyright notice, this
12
+ # list of conditions and the following disclaimer in the documentation and/or other
13
+ # materials provided with the distribution.
14
+
15
+ # Neither the name of the copyright holder nor the names of its contributors may be
16
+ # used to endorse or promote products derived from this software without specific
17
+ # prior written permission.
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
29
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30
+ # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31
+ # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32
+ # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34
+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
36
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
37
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
38
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
39
+ # *********************************************************************************
35
40
 
36
41
  module OsLib_HelperMethods
37
42
  # populate choice argument from model objects
@@ -396,4 +401,4 @@ module OsLib_HelperMethods
396
401
 
397
402
  # OpenStudio has built in helper for unit conversion. That can be done using OpenStudio::convert() as shown below.
398
403
  # OpenStudio::convert(double,"from unit string","to unit string").get
399
- end
404
+ end
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -1,21 +1,31 @@
1
1
  # *********************************************************************************
2
- # URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
3
3
  # contributors. All rights reserved.
4
- #
4
+
5
5
  # Redistribution and use in source and binary forms, with or without modification,
6
6
  # are permitted provided that the following conditions are met:
7
- #
7
+
8
8
  # Redistributions of source code must retain the above copyright notice, this list
9
9
  # of conditions and the following disclaimer.
10
- #
10
+
11
11
  # Redistributions in binary form must reproduce the above copyright notice, this
12
12
  # list of conditions and the following disclaimer in the documentation and/or other
13
13
  # materials provided with the distribution.
14
- #
14
+
15
15
  # Neither the name of the copyright holder nor the names of its contributors may be
16
16
  # used to endorse or promote products derived from this software without specific
17
17
  # prior written permission.
18
- #
18
+
19
+ # Redistribution of this software, without modification, must refer to the software
20
+ # by the same designation. Redistribution of a modified version of this software
21
+ # (i) may not refer to the modified version by the same designation, or by any
22
+ # confusingly similar designation, and (ii) must refer to the underlying software
23
+ # originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
24
+ # the term “URBANopt”, or any confusingly similar designation may not be used to
25
+ # refer to any modified version of this software or any modified version of the
26
+ # underlying software originally provided by Alliance without the prior written
27
+ # consent of Alliance.
28
+
19
29
  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
30
  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
31
  # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
@@ -38,7 +48,7 @@ module URBANopt
38
48
  # Enduse class all enduse energy consumption results.
39
49
  ##
40
50
  class EndUse
41
- attr_accessor :heating, :cooling, :interior_lighting, :exterior_lighting, :interior_equipment, :exterior_equipment,
51
+ attr_accessor :heating, :cooling, :interior_lighting, :exterior_lighting, :interior_equipment, :exterior_equipment, :electric_vehicles,
42
52
  :fans, :pumps, :heat_rejection, :humidification, :heat_recovery, :water_systems, :refrigeration, :generators # :nodoc:
43
53
 
44
54
  ##
@@ -59,6 +69,7 @@ module URBANopt
59
69
  @exterior_lighting = hash[:exterior_lighting]
60
70
  @interior_equipment = hash[:interior_equipment]
61
71
  @exterior_equipment = hash[:exterior_equipment]
72
+ @electric_vehicles = hash[:electric_vehicles]
62
73
  @fans = hash[:fans]
63
74
  @pumps = hash[:pumps]
64
75
  @heat_rejection = hash[:heat_rejection]
@@ -85,6 +96,7 @@ module URBANopt
85
96
  hash[:exterior_lighting] = nil
86
97
  hash[:interior_equipment] = nil
87
98
  hash[:exterior_equipment] = nil
99
+ hash[:electric_vehicles] = nil
88
100
  hash[:fans] = nil
89
101
  hash[:pumps] = nil
90
102
  hash[:heat_rejection] = nil
@@ -112,6 +124,7 @@ module URBANopt
112
124
  result[:exterior_lighting] = @exterior_lighting
113
125
  result[:interior_equipment] = @interior_equipment
114
126
  result[:exterior_equipment] = @exterior_equipment
127
+ result[:electric_vehicles] = @electric_vehicles
115
128
  result[:fans] = @fans
116
129
  result[:pumps] = @pumps
117
130
  result[:heat_rejection] = @heat_rejection
@@ -129,27 +142,45 @@ module URBANopt
129
142
  return result
130
143
  end
131
144
 
145
+ ##
146
+ # Adds up +existing_value+ and +new_values+ if not nill.
147
+ ##
148
+ # [parameter:]
149
+ # +existing_value+ - _Float_ - A value corresponding to a EndUse attribute.
150
+ ##
151
+ # +new_value+ - _Float_ - A value corresponding to a EndUse attribute.
152
+ ##
153
+ def add_values(existing_value, new_value)
154
+ if existing_value && new_value
155
+ existing_value += new_value
156
+ elsif new_value
157
+ existing_value = new_value
158
+ end
159
+ return existing_value
160
+ end
161
+
132
162
  ##
133
163
  # Aggregate values of each EndUse attribute.
134
164
  ##
135
165
  # [Parameters:]
136
- # +new_end_use+ - _EndUse_ - An object of EndUse class.
166
+ # +other+ - _EndUse_ - An object of EndUse class.
137
167
  ##
138
- def merge_end_use!(new_end_use)
139
- @heating += new_end_use.heating if new_end_use.heating
140
- @cooling += new_end_use.cooling if new_end_use.cooling
141
- @interior_lighting += new_end_use.interior_lighting if new_end_use.interior_lighting
142
- @exterior_lighting += new_end_use.exterior_lighting if new_end_use.exterior_lighting
143
- @interior_equipment += new_end_use.interior_equipment if new_end_use.interior_equipment
144
- @exterior_equipment += new_end_use.exterior_equipment if new_end_use.exterior_equipment
145
- @fans += new_end_use.fans if new_end_use.fans
146
- @pumps += new_end_use.pumps if new_end_use.pumps
147
- @heat_rejection += new_end_use.heat_rejection if new_end_use.heat_rejection
148
- @humidification += new_end_use.humidification if new_end_use.humidification
149
- @heat_recovery += new_end_use.heat_recovery if new_end_use.heat_recovery
150
- @water_systems += new_end_use.water_systems if new_end_use.water_systems
151
- @refrigeration += new_end_use.refrigeration if new_end_use.refrigeration
152
- @generators += new_end_use.generators if new_end_use.generators
168
+ def merge_end_use!(other)
169
+ @heating = add_values(@heating, other.heating)
170
+ @cooling = add_values(@cooling, other.cooling)
171
+ @interior_lighting = add_values(@interior_lighting, other.interior_lighting)
172
+ @exterior_lighting = add_values(@exterior_lighting, other.exterior_lighting)
173
+ @interior_equipment = add_values(@interior_equipment, other.interior_equipment)
174
+ @exterior_equipment = add_values(@exterior_equipment, other.exterior_equipment)
175
+ @electric_vehicles = add_values(@electric_vehicles, other.electric_vehicles)
176
+ @fans = add_values(@fans, other.fans)
177
+ @pumps = add_values(@pumps, other.pumps)
178
+ @heat_rejection = add_values(@heat_rejection, other.heat_rejection)
179
+ @humidification = add_values(@humidification, other.humidification)
180
+ @heat_recovery = add_values(@heat_recovery, other.heat_recovery)
181
+ @water_systems = add_values(@water_systems, other.water_systems)
182
+ @refrigeration = add_values(@refrigeration, other.refrigeration)
183
+ @generators = add_values(@generators, other.generators)
153
184
 
154
185
  return self
155
186
  end