First time here? Check out the Help page!
1 | initial version |
Here is an example where I create a variable interval schedule from a ScheduleRuleset. Keep in mind that you won't be able to inspect the resulting schedule in OpenStudio application.
yd = model.getYearDescription
start_date = yd.makeDate(1,1)
end_date = yd.makeDate(12,31)
values = OpenStudio::DoubleVector.new
day = OpenStudio::Time.new(1.0)
interval = OpenStudio::Time.new(1.0/48.0)
day_schedules = schedule_ruleset.to_ScheduleRuleset.get.getDaySchedules(start_date,end_date)
day_schedules.each do |day_schedule|
time = interval
while time < day
values << day_schedule.getValue(time)
time += interval
end
end
time_series = OpenStudio::TimeSeries.new(start_date, interval, OpenStudio::createVector(values), "")
schedule = OpenStudio::Model::ScheduleInterval.fromTimeSeries(time_series, model).get
2 | No.2 Revision |
Here is an example where I create a variable interval schedule ScheduleInterval from a ScheduleRuleset. Keep in mind that you won't be able to inspect the resulting schedule in OpenStudio application.
yd = model.getYearDescription
start_date = yd.makeDate(1,1)
end_date = yd.makeDate(12,31)
values = OpenStudio::DoubleVector.new
day = OpenStudio::Time.new(1.0)
interval = OpenStudio::Time.new(1.0/48.0)
day_schedules = schedule_ruleset.to_ScheduleRuleset.get.getDaySchedules(start_date,end_date)
day_schedules.each do |day_schedule|
time = interval
while time < day
values << day_schedule.getValue(time)
time += interval
end
end
time_series = OpenStudio::TimeSeries.new(start_date, interval, OpenStudio::createVector(values), "")
schedule = OpenStudio::Model::ScheduleInterval.fromTimeSeries(time_series, model).get
3 | No.3 Revision |
Here is an example where I create a ScheduleInterval from a ScheduleRuleset. Keep in mind that you won't be able to inspect the resulting schedule in OpenStudio application.application. ScheduleVariableInterval should be similar.
yd = model.getYearDescription
start_date = yd.makeDate(1,1)
end_date = yd.makeDate(12,31)
values = OpenStudio::DoubleVector.new
day = OpenStudio::Time.new(1.0)
interval = OpenStudio::Time.new(1.0/48.0)
day_schedules = schedule_ruleset.to_ScheduleRuleset.get.getDaySchedules(start_date,end_date)
day_schedules.each do |day_schedule|
time = interval
while time < day
values << day_schedule.getValue(time)
time += interval
end
end
time_series = OpenStudio::TimeSeries.new(start_date, interval, OpenStudio::createVector(values), "")
schedule = OpenStudio::Model::ScheduleInterval.fromTimeSeries(time_series, model).get
4 | No.4 Revision |
Here is an example where I create a ScheduleInterval from a ScheduleRuleset. Keep in mind that you won't be able to inspect the resulting schedule in OpenStudio application. While it is not as similar to ScheduleVariableInterval should as I thought, it still may be similar.a helpful example.
yd = model.getYearDescription
start_date = yd.makeDate(1,1)
end_date = yd.makeDate(12,31)
values = OpenStudio::DoubleVector.new
day = OpenStudio::Time.new(1.0)
interval = OpenStudio::Time.new(1.0/48.0)
day_schedules = schedule_ruleset.to_ScheduleRuleset.get.getDaySchedules(start_date,end_date)
day_schedules.each do |day_schedule|
time = interval
while time < day
values << day_schedule.getValue(time)
time += interval
end
end
time_series = OpenStudio::TimeSeries.new(start_date, interval, OpenStudio::createVector(values), "")
schedule = OpenStudio::Model::ScheduleInterval.fromTimeSeries(time_series, model).get