38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# File 'lib/openstudio-standards/btap/schedules.rb', line 38
def test_create_all_schedule_types()
model = OpenStudio::Model::Model.new()
schedule_struct =
[
[
["Jan-01","May-31"],
["M","T","W","TH","F","S","SN"], [
[ "9:00", 13.0], [ "17:00", 21.0] ]
],
[
["Jun-01","Sep-30"],
["M","T","W","TH","F","S","SN"], [
["24:00", 13.0] ]
],
[
[ "Oct-01","Dec-31"],
["M","T","W","TH","F","S","SN"], [
[ "9:00", 1], [ "17:00", 2] ]
]
]
temperature_array =
[
Array.new(24){21}, Array.new(24){21}, Array.new(24){21}, ]
fraction_array =
[
Array.new(24){0.5}, Array.new(24){0.5}, Array.new(24){0.5}, ]
on_off_array =
[
Array.new(24){1}, Array.new(24){0}, Array.new(24){0}, ]
temperature_ruleset_sched = BTAP::Resources::Schedules::create_annual_ruleset_schedule(model,"test schedule ruleset","TEMPERATURE",temperature_array)
assert( !(temperature_ruleset_sched.to_ScheduleRuleset.empty?))
BTAP::Resources::Schedules::modify_schedule!(model, temperature_ruleset_sched, 0.90 , "*")
temperature_ruleset_sched.scheduleRules.each do |week_rule|
week_rule.daySchedule().values.each do |value|
assert_in_delta(21.0 * 0.90,value,0.000001)
end
end
fraction_ruleset_sched = BTAP::Resources::Schedules::create_annual_ruleset_schedule(model,"test schedule ruleset","FRACTION",fraction_array)
assert( !(fraction_ruleset_sched.to_ScheduleRuleset.empty?))
on_off_ruleset_sched = BTAP::Resources::Schedules::create_annual_ruleset_schedule(model,"test schedule ruleset","ON_OFF",on_off_array)
assert( !(on_off_ruleset_sched.to_ScheduleRuleset.empty?))
constant_ruleset_sched = BTAP::Resources::Schedules::create_annual_constant_ruleset_schedule(model,"test constant schedule","TEMPERATURE",21)
assert( !(constant_ruleset_sched.to_ScheduleRuleset.empty?))
dual_setpoint_schedule = BTAP::Resources::Schedules::create_annual_thermostat_setpoint_dual_setpoint(model,"dual setpoint test",constant_ruleset_sched,constant_ruleset_sched)
assert( !(dual_setpoint_schedule.to_ThermostatSetpointDualSetpoint.empty?))
detailed_ruleset_schedule = BTAP::Resources::Schedules::create_annual_ruleset_schedule_detailed(model,"test detailed schedule","FRACTION",schedule_struct )
assert( !(detailed_ruleset_schedule.to_ScheduleRuleset.empty?))
end
|