urbanopt-cli 0.6.0 → 0.6.4
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 +1 -0
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +38 -0
- data/CMakeLists.txt +13 -13
- data/FindOpenStudioSDK.cmake +11 -6
- data/Gemfile +11 -5
- data/example_files/Gemfile +6 -3
- data/example_files/base_workflow_res.osw +10 -0
- data/example_files/example_project_combined.json +13 -3
- data/example_files/example_project_with_PV.json +751 -0
- data/example_files/example_project_with_streets.json +826 -0
- data/example_files/mappers/Baseline.rb +69 -14
- data/example_files/mappers/CreateBar.rb +31 -1
- data/example_files/mappers/FlexibleHotWater.rb +69 -0
- data/example_files/mappers/Floorspace.rb +31 -1
- data/example_files/mappers/HighEfficiency.rb +20 -8
- data/example_files/mappers/HighEfficiencyCreateBar.rb +3 -2
- data/example_files/mappers/HighEfficiencyFloorspace.rb +3 -2
- data/example_files/mappers/base_workflow.osw +5 -0
- data/example_files/mappers/createbar_workflow.osw +3 -1
- data/example_files/mappers/floorspace_workflow.osw +2 -1
- data/example_files/osm_building/7.osm +0 -307
- data/example_files/osm_building/8.osm +0 -419
- data/example_files/osm_building/9.osm +0 -664
- data/example_files/reopt/base_assumptions.json +3 -3
- data/example_files/reopt/multiPV_assumptions.json +2 -2
- data/example_files/resources/hpxml-measures/Gemfile +1 -1
- data/example_files/resources/hpxml-measures/Gemfile.lock +6 -25
- data/example_files/visualization/input_visualization_feature.html +15 -16
- data/example_files/visualization/input_visualization_scenario.html +16 -11
- data/lib/uo_cli/version.rb +1 -1
- data/lib/uo_cli.rb +158 -26
- data/scripts/setup-env-gitbash.sh +4 -4
- data/scripts/setup-env-unix.sh +4 -4
- data/scripts/setup-env.bat +3 -3
- data/scripts/setup-env.ps1 +3 -3
- data/uo_cli.gemspec +8 -5
- metadata +59 -14
@@ -1,21 +1,31 @@
|
|
1
|
-
|
2
|
-
# URBANopt™, Copyright (c) 2019-
|
1
|
+
# *********************************************************************************
|
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.
|
@@ -26,13 +36,14 @@
|
|
26
36
|
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
27
37
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
28
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
|
39
|
+
# *********************************************************************************
|
30
40
|
|
31
41
|
require 'urbanopt/reporting'
|
32
42
|
require 'openstudio/common_measures'
|
33
43
|
require 'openstudio/model_articulation'
|
34
44
|
require 'openstudio/ee_measures'
|
35
45
|
require 'openstudio/calibration'
|
46
|
+
require 'openstudio/load_flexibility_measures'
|
36
47
|
|
37
48
|
require 'json'
|
38
49
|
require 'rexml/document'
|
@@ -147,7 +158,7 @@ module URBANopt
|
|
147
158
|
when "Inpatient health care"
|
148
159
|
return "Hospital"
|
149
160
|
when "Laboratory"
|
150
|
-
return "
|
161
|
+
return "Laboratory"
|
151
162
|
when "Lodging"
|
152
163
|
if number_of_stories
|
153
164
|
if number_of_stories.to_i > 3
|
@@ -278,7 +289,10 @@ module URBANopt
|
|
278
289
|
'Service',
|
279
290
|
'Uncovered Parking',
|
280
291
|
'Covered Parking',
|
281
|
-
'Mixed use'
|
292
|
+
'Mixed use',
|
293
|
+
'Multifamily (2 to 4 units)',
|
294
|
+
'Multifamily (5 or more units)',
|
295
|
+
'Single-Family'
|
282
296
|
]
|
283
297
|
end
|
284
298
|
|
@@ -388,9 +402,6 @@ module URBANopt
|
|
388
402
|
feature_id = feature.id
|
389
403
|
feature_type = feature.type
|
390
404
|
|
391
|
-
# take the first vertex as the location of the building
|
392
|
-
#feature_location = feature.feature_json[:geometry][:coordinates][0][0].to_s
|
393
|
-
|
394
405
|
# take the centroid of the vertices as the location of the building
|
395
406
|
feature_vertices_coordinates = feature.feature_json[:geometry][:coordinates][0]
|
396
407
|
feature_location = feature.find_feature_center(feature_vertices_coordinates).to_s
|
@@ -411,6 +422,11 @@ module URBANopt
|
|
411
422
|
|
412
423
|
building_type = feature.building_type
|
413
424
|
|
425
|
+
if building_type.nil?
|
426
|
+
# need building type
|
427
|
+
raise "Building type is not set"
|
428
|
+
end
|
429
|
+
|
414
430
|
if residential_building_types.include? building_type
|
415
431
|
debug = false
|
416
432
|
|
@@ -520,8 +536,13 @@ module URBANopt
|
|
520
536
|
|
521
537
|
# SCHEDULES
|
522
538
|
|
539
|
+
feature_ids = []
|
540
|
+
scenario.feature_file.features.each do |feature|
|
541
|
+
feature_ids << feature.id
|
542
|
+
end
|
543
|
+
|
523
544
|
args[:schedules_type] = 'stochastic'
|
524
|
-
args[:feature_id] = feature_id
|
545
|
+
args[:feature_id] = feature_ids.index(feature_id)
|
525
546
|
args[:schedules_variation] = 'building' # building or unit
|
526
547
|
|
527
548
|
# HVAC
|
@@ -723,10 +744,13 @@ module URBANopt
|
|
723
744
|
|
724
745
|
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', '__SKIP__', false)
|
725
746
|
# set_run_period
|
747
|
+
|
726
748
|
begin
|
727
749
|
timesteps_per_hour = feature.timesteps_per_hour
|
728
750
|
if timesteps_per_hour
|
729
751
|
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', 'timesteps_per_hour', timesteps_per_hour)
|
752
|
+
else
|
753
|
+
puts "No timesteps_per_hours set in the feature file...using default"
|
730
754
|
end
|
731
755
|
rescue StandardError
|
732
756
|
end
|
@@ -738,6 +762,8 @@ module URBANopt
|
|
738
762
|
begin_date = begin_date[0, 10]
|
739
763
|
end
|
740
764
|
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', 'begin_date', begin_date)
|
765
|
+
else
|
766
|
+
puts "no simulation begin_date set in the feature file...using default"
|
741
767
|
end
|
742
768
|
rescue StandardError
|
743
769
|
end
|
@@ -749,6 +775,8 @@ module URBANopt
|
|
749
775
|
end_date = end_date[0, 10]
|
750
776
|
end
|
751
777
|
OpenStudio::Extension.set_measure_argument(osw, 'set_run_period', 'end_date', end_date)
|
778
|
+
else
|
779
|
+
puts "no simulation end_date set in the feature file...using default"
|
752
780
|
end
|
753
781
|
rescue StandardError
|
754
782
|
end
|
@@ -780,6 +808,9 @@ module URBANopt
|
|
780
808
|
number_of_stories_below_ground = 0
|
781
809
|
end
|
782
810
|
template = building_hash.key?(:template) ? building_hash[:template] : nil
|
811
|
+
if template.nil?
|
812
|
+
raise "Template is not defined in the feature file"
|
813
|
+
end
|
783
814
|
footprint_area = building_hash[:footprint_area]
|
784
815
|
|
785
816
|
mapped_building_type_1 = lookup_building_type(building_type_1, template, footprint_area, number_of_stories)
|
@@ -902,12 +933,17 @@ module URBANopt
|
|
902
933
|
end
|
903
934
|
end
|
904
935
|
|
936
|
+
# geojson schema doesn't have modify_wkdy_op_hrs and modify_wknd_op_hrs checking for both start and duration to set to true in osw
|
937
|
+
weekday_flag = 0 # set modify arg to true of this gets to 2
|
938
|
+
weekend_flag = 0 # set modify arg to true of this gets to 2
|
939
|
+
|
905
940
|
# set weekday start time
|
906
941
|
begin
|
907
942
|
weekday_start_time = feature.weekday_start_time
|
908
943
|
if !feature.weekday_start_time.empty?
|
909
944
|
new_weekday_start_time = time_mapping(weekday_start_time)
|
910
945
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wkdy_op_hrs_start_time', new_weekday_start_time, 'create_typical_building_from_model 1')
|
946
|
+
weekday_flag += 1
|
911
947
|
end
|
912
948
|
rescue
|
913
949
|
end
|
@@ -918,6 +954,15 @@ module URBANopt
|
|
918
954
|
if !feature.weekday_duration.empty?
|
919
955
|
new_weekday_duration = time_mapping(weekday_duration)
|
920
956
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wkdy_op_hrs_duration', new_weekday_duration, 'create_typical_building_from_model 1')
|
957
|
+
weekday_flag += 1
|
958
|
+
end
|
959
|
+
rescue
|
960
|
+
end
|
961
|
+
|
962
|
+
# set weekday modify
|
963
|
+
begin
|
964
|
+
if weekday_flag == 2
|
965
|
+
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'modify_wkdy_op_hrs', true, 'create_typical_building_from_model 1')
|
921
966
|
end
|
922
967
|
rescue
|
923
968
|
end
|
@@ -928,6 +973,7 @@ module URBANopt
|
|
928
973
|
if !feature.weekend_start_time.empty?
|
929
974
|
new_weekend_start_time = time_mapping(weekend_start_time)
|
930
975
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wknd_op_hrs_start_time', new_weekend_start_time, 'create_typical_building_from_model 1')
|
976
|
+
weekend_flag += 1
|
931
977
|
end
|
932
978
|
rescue
|
933
979
|
end
|
@@ -938,10 +984,19 @@ module URBANopt
|
|
938
984
|
if !feature.weekend_duration.empty?
|
939
985
|
new_weekend_duration = time_mapping(weekend_duration)
|
940
986
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wknd_op_hrs_duration', new_weekend_duration, 'create_typical_building_from_model 1')
|
987
|
+
weekend_flag += 1
|
941
988
|
end
|
942
989
|
rescue
|
943
990
|
end
|
944
991
|
|
992
|
+
# set weekday modify
|
993
|
+
begin
|
994
|
+
if weekend_flag == 2
|
995
|
+
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'modify_wknd_op_hrs', true, 'create_typical_building_from_model 1')
|
996
|
+
end
|
997
|
+
rescue
|
998
|
+
end
|
999
|
+
|
945
1000
|
# template
|
946
1001
|
begin
|
947
1002
|
new_template = nil
|
@@ -38,7 +38,7 @@
|
|
38
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
39
39
|
# *********************************************************************************
|
40
40
|
|
41
|
-
require 'urbanopt/
|
41
|
+
require 'urbanopt/reporting'
|
42
42
|
require 'openstudio/common_measures'
|
43
43
|
require 'openstudio/model_articulation'
|
44
44
|
require 'openstudio/ee_measures'
|
@@ -258,7 +258,12 @@ module URBANopt
|
|
258
258
|
feature = features[0]
|
259
259
|
feature_id = feature.id
|
260
260
|
feature_type = feature.type
|
261
|
+
# take the centroid of the vertices as the location of the building
|
262
|
+
feature_vertices_coordinates = feature.feature_json[:geometry][:coordinates][0]
|
263
|
+
feature_location = feature.find_feature_center(feature_vertices_coordinates).to_s
|
264
|
+
|
261
265
|
feature_name = feature.name
|
266
|
+
|
262
267
|
if feature_names.size == 1
|
263
268
|
feature_name = feature_names[0]
|
264
269
|
end
|
@@ -453,12 +458,17 @@ module URBANopt
|
|
453
458
|
end
|
454
459
|
end
|
455
460
|
|
461
|
+
# geojson schema doesn't have modify_wkdy_op_hrs and modify_wknd_op_hrs checking for both start and duration to set to true in osw
|
462
|
+
weekday_flag = 0 # set modify arg to true of this gets to 2
|
463
|
+
weekend_flag = 0 # set modify arg to true of this gets to 2
|
464
|
+
|
456
465
|
# set weekday start time
|
457
466
|
begin
|
458
467
|
weekday_start_time = feature.weekday_start_time
|
459
468
|
if !feature.weekday_start_time.empty?
|
460
469
|
new_weekday_start_time = time_mapping(weekday_start_time)
|
461
470
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wkdy_op_hrs_start_time', new_weekday_start_time, 'create_typical_building_from_model')
|
471
|
+
weekday_flag += 1
|
462
472
|
end
|
463
473
|
rescue StandardError
|
464
474
|
end
|
@@ -469,6 +479,15 @@ module URBANopt
|
|
469
479
|
if !feature.weekday_duration.empty?
|
470
480
|
new_weekday_duration = time_mapping(weekday_duration)
|
471
481
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wkdy_op_hrs_duration', new_weekday_duration, 'create_typical_building_from_model')
|
482
|
+
weekday_flag += 1
|
483
|
+
end
|
484
|
+
rescue StandardError
|
485
|
+
end
|
486
|
+
|
487
|
+
# set weekday modify
|
488
|
+
begin
|
489
|
+
if weekday_flag == 2
|
490
|
+
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'modify_wknd_op_hrs', true, 'create_typical_building_from_model')
|
472
491
|
end
|
473
492
|
rescue StandardError
|
474
493
|
end
|
@@ -479,6 +498,7 @@ module URBANopt
|
|
479
498
|
if !feature.weekend_start_time.empty?
|
480
499
|
new_weekend_start_time = time_mapping(weekend_start_time)
|
481
500
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wknd_op_hrs_start_time', new_weekend_start_time, 'create_typical_building_from_model')
|
501
|
+
weekend_flag += 1
|
482
502
|
end
|
483
503
|
rescue StandardError
|
484
504
|
end
|
@@ -489,6 +509,15 @@ module URBANopt
|
|
489
509
|
if !feature.weekend_duration.empty?
|
490
510
|
new_weekend_duration = time_mapping(weekend_duration)
|
491
511
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wknd_op_hrs_duration', new_weekend_duration, 'create_typical_building_from_model')
|
512
|
+
weekend_flag += 1
|
513
|
+
end
|
514
|
+
rescue StandardError
|
515
|
+
end
|
516
|
+
|
517
|
+
# set weekday modify
|
518
|
+
begin
|
519
|
+
if weekend_flag == 2
|
520
|
+
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'modify_wkdy_op_hrs', true, 'create_typical_building_from_model')
|
492
521
|
end
|
493
522
|
rescue StandardError
|
494
523
|
end
|
@@ -552,6 +581,7 @@ module URBANopt
|
|
552
581
|
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_id', feature_id)
|
553
582
|
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_name', feature_name)
|
554
583
|
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_type', feature_type)
|
584
|
+
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_location', feature_location)
|
555
585
|
end
|
556
586
|
|
557
587
|
return osw
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#*********************************************************************************
|
2
|
+
# URBANopt™, Copyright (c) 2019-2020, 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
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
20
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
21
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
22
|
+
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
23
|
+
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
24
|
+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
26
|
+
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
27
|
+
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
28
|
+
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
#*********************************************************************************
|
30
|
+
|
31
|
+
require 'urbanopt/reporting'
|
32
|
+
|
33
|
+
require_relative 'Baseline'
|
34
|
+
|
35
|
+
require 'json'
|
36
|
+
|
37
|
+
module URBANopt
|
38
|
+
module Scenario
|
39
|
+
class FlexibleHotWaterMapper < BaselineMapper
|
40
|
+
|
41
|
+
def create_osw(scenario, features, feature_names)
|
42
|
+
|
43
|
+
osw = super(scenario, features, feature_names)
|
44
|
+
|
45
|
+
feature = features[0]
|
46
|
+
building_type = feature.building_type
|
47
|
+
|
48
|
+
# Only apply to commercial buildings, not residential models
|
49
|
+
if commercial_building_types.include? building_type
|
50
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', '__SKIP__', false)
|
51
|
+
# Add a sizing multiplier to the tank capacity to cover flex periods
|
52
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'vol', 2)
|
53
|
+
# Update maximum tank and minimum temperature setpoints
|
54
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'max_temp', 185)
|
55
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'min_temp', 125)
|
56
|
+
|
57
|
+
# Manage water heat charge float periods by building
|
58
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'flex0', 'Charge - Heat Pump')
|
59
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'flex_hrs0', '16:00-17:00')
|
60
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'flex1', 'Float')
|
61
|
+
OpenStudio::Extension.set_measure_argument(osw, 'add_hpwh', 'flex_hrs1', '17:01-19:00')
|
62
|
+
end
|
63
|
+
|
64
|
+
return osw
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -38,7 +38,7 @@
|
|
38
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
39
39
|
# *********************************************************************************
|
40
40
|
|
41
|
-
require 'urbanopt/
|
41
|
+
require 'urbanopt/reporting'
|
42
42
|
require 'openstudio/common_measures'
|
43
43
|
require 'openstudio/model_articulation'
|
44
44
|
require 'openstudio/ee_measures'
|
@@ -258,6 +258,11 @@ module URBANopt
|
|
258
258
|
feature = features[0]
|
259
259
|
feature_id = feature.id
|
260
260
|
feature_type = feature.type
|
261
|
+
|
262
|
+
# take the centroid of the vertices as the location of the building
|
263
|
+
feature_vertices_coordinates = feature.feature_json[:geometry][:coordinates][0]
|
264
|
+
feature_location = feature.find_feature_center(feature_vertices_coordinates).to_s
|
265
|
+
|
261
266
|
feature_name = feature.name
|
262
267
|
if feature_names.size == 1
|
263
268
|
feature_name = feature_names[0]
|
@@ -539,12 +544,17 @@ module URBANopt
|
|
539
544
|
end
|
540
545
|
end
|
541
546
|
|
547
|
+
# geojson schema doesn't have modify_wkdy_op_hrs and modify_wknd_op_hrs checking for both start and duration to set to true in osw
|
548
|
+
weekday_flag = 0 # set modify arg to true of this gets to 2
|
549
|
+
weekend_flag = 0 # set modify arg to true of this gets to 2
|
550
|
+
|
542
551
|
# set weekday start time
|
543
552
|
begin
|
544
553
|
weekday_start_time = feature.weekday_start_time
|
545
554
|
if !feature.weekday_start_time.empty?
|
546
555
|
new_weekday_start_time = time_mapping(weekday_start_time)
|
547
556
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wkdy_op_hrs_start_time', new_weekday_start_time, 'create_typical_building_from_model 1')
|
557
|
+
weekday_flag += 1
|
548
558
|
end
|
549
559
|
rescue StandardError
|
550
560
|
end
|
@@ -555,6 +565,15 @@ module URBANopt
|
|
555
565
|
if !feature.weekday_duration.empty?
|
556
566
|
new_weekday_duration = time_mapping(weekday_duration)
|
557
567
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wkdy_op_hrs_duration', new_weekday_duration, 'create_typical_building_from_model 1')
|
568
|
+
weekday_flag += 1
|
569
|
+
end
|
570
|
+
rescue StandardError
|
571
|
+
end
|
572
|
+
|
573
|
+
# set weekday modify
|
574
|
+
begin
|
575
|
+
if weekday_flag == 2
|
576
|
+
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'modify_wkdy_op_hrs', true, 'create_typical_building_from_model 1')
|
558
577
|
end
|
559
578
|
rescue StandardError
|
560
579
|
end
|
@@ -565,6 +584,7 @@ module URBANopt
|
|
565
584
|
if !feature.weekend_start_time.empty?
|
566
585
|
new_weekend_start_time = time_mapping(weekend_start_time)
|
567
586
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wknd_op_hrs_start_time', new_weekend_start_time, 'create_typical_building_from_model 1')
|
587
|
+
weekend_flag += 1
|
568
588
|
end
|
569
589
|
rescue StandardError
|
570
590
|
end
|
@@ -575,6 +595,15 @@ module URBANopt
|
|
575
595
|
if !feature.weekend_duration.empty?
|
576
596
|
new_weekend_duration = time_mapping(weekend_duration)
|
577
597
|
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'wknd_op_hrs_duration', new_weekend_duration, 'create_typical_building_from_model 1')
|
598
|
+
weekend_flag += 1
|
599
|
+
end
|
600
|
+
rescue StandardError
|
601
|
+
end
|
602
|
+
|
603
|
+
# set weekday modify
|
604
|
+
begin
|
605
|
+
if weekend_flag == 2
|
606
|
+
OpenStudio::Extension.set_measure_argument(osw, 'create_typical_building_from_model', 'modify_wknd_op_hrs', true, 'create_typical_building_from_model 1')
|
578
607
|
end
|
579
608
|
rescue StandardError
|
580
609
|
end
|
@@ -656,6 +685,7 @@ module URBANopt
|
|
656
685
|
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_id', feature_id)
|
657
686
|
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_name', feature_name)
|
658
687
|
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_type', feature_type)
|
688
|
+
OpenStudio::Extension.set_measure_argument(osw, 'default_feature_reports', 'feature_location', feature_location)
|
659
689
|
end
|
660
690
|
|
661
691
|
return osw
|
@@ -1,21 +1,31 @@
|
|
1
|
-
|
2
|
-
# URBANopt™, Copyright (c) 2019-
|
1
|
+
# *********************************************************************************
|
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.
|
@@ -26,11 +36,13 @@
|
|
26
36
|
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
27
37
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
28
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
|
39
|
+
# *********************************************************************************
|
30
40
|
|
31
41
|
require 'urbanopt/reporting'
|
32
42
|
require 'openstudio/common_measures'
|
33
43
|
require 'openstudio/model_articulation'
|
44
|
+
require 'openstudio/ee_measures'
|
45
|
+
require 'openstudio/calibration'
|
34
46
|
|
35
47
|
require_relative 'Baseline'
|
36
48
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# *********************************************************************************
|
3
2
|
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
|
4
3
|
# contributors. All rights reserved.
|
@@ -39,9 +38,11 @@
|
|
39
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
40
39
|
# *********************************************************************************
|
41
40
|
|
42
|
-
require 'urbanopt/
|
41
|
+
require 'urbanopt/reporting'
|
43
42
|
require 'openstudio/common_measures'
|
44
43
|
require 'openstudio/model_articulation'
|
44
|
+
require 'openstudio/ee_measures'
|
45
|
+
require 'openstudio/calibration'
|
45
46
|
|
46
47
|
require_relative 'CreateBar'
|
47
48
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# *********************************************************************************
|
3
2
|
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
|
4
3
|
# contributors. All rights reserved.
|
@@ -39,9 +38,11 @@
|
|
39
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
40
39
|
# *********************************************************************************
|
41
40
|
|
42
|
-
require 'urbanopt/
|
41
|
+
require 'urbanopt/reporting'
|
43
42
|
require 'openstudio/common_measures'
|
44
43
|
require 'openstudio/model_articulation'
|
44
|
+
require 'openstudio/ee_measures'
|
45
|
+
require 'openstudio/calibration'
|
45
46
|
|
46
47
|
require_relative 'Floorspace'
|
47
48
|
|
@@ -40,6 +40,7 @@
|
|
40
40
|
"num_stories_above_grade": null,
|
41
41
|
"num_stories_below_grade": null,
|
42
42
|
"building_rotation": 0,
|
43
|
+
"perim_mult": 0,
|
43
44
|
"template": "90.1-2004",
|
44
45
|
"ns_to_ew_ratio": 0,
|
45
46
|
"wwr": 0,
|
@@ -89,7 +90,8 @@
|
|
89
90
|
"arguments": {
|
90
91
|
"feature_id": null,
|
91
92
|
"feature_name": null,
|
92
|
-
"feature_type": null
|
93
|
+
"feature_type": null,
|
94
|
+
"feature_location": null
|
93
95
|
}
|
94
96
|
}
|
95
97
|
],
|