3

How to create a new compact schedule by measure?

I am considering to write a new measure after reading through the Measure Writing Guide.

My measure is to create a compact schedule (my_schedule) for the stuck outdoor air damper. I want to implement this idea through creating a new schedule and then assign the new schedule automatically, together with the stuck percentage (say, 80%), from user input, to whatever the air flow specified. Thus the final outside air flow is: my_schedule*stuck_percentage*specified_airflow. My compact schedule is: 1 from 9am to 5pm, 0 from 5pm to 9am, all year around.

I read through the SDK document about the functions (methods), related to the Schedule, and get a path of schedule objects:

WorkspaceObject-->ModelObject-->ParentObject-->ResourceObject-->ScheduleBase-->Schedule-->ScheduleCompact.
I tried the member functions of ScheduleCompact. But i got errors after applying the measure with following errors:

C:/Users/...(path to be neglected).../: in 'run': uninitialized constant OpenStudio::Model::CompactSchedule(NameError)

where the lines i setup the schedule is:

my_schedule=OpenStudio::Model::ScheduleCompact::ScheduleCompact(model)
my_schedule.setToConstantValue(stuck_percentage)

My idea is to initialize a proportional type compact schedule, and then utilize the stuck_percentage to the schedule value, and finally apply the newly created compact schedule to the air damper. The only thing users need to do is to give the value of stuck_percentage.

building_performance's avatar
441
building_performance
asked 2015-05-18 12:30:19 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-08-05 13:25:14 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

3

First, while you can use a compact schedule, you may consider a ruleset schedule so you can inspect it in the GUI after you make it, but you can also use compact or constant. Below is some information on the API methods for compact schedule.

This page shows you direct methods just for schedule compact https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-1.7.0-doc/model/html/classopenstudio_1_1model_1_1_schedule_compact.html

It looks like you already know how to look through the inheritance diagram to see objects that ScheduleCompact inherit from. If you want to see all the methods you can use on ScheduleComplact without having to drill your way down the tree click "List of all members" as shown on this screenshot.

image description

Here is the resulting link https://openstudio-sdk-documentation.s3.amazonaws.com/cpp/OpenStudio-1.7.0-doc/model/html/classopenstudio_1_1model_1_1_schedule_compact-members.html

David Goldwasser's avatar
20.4k
David Goldwasser
answered 2015-05-18 15:48:54 -0500, updated 2015-05-18 15:50:31 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
2

I agree with David's suggestion to use ScheduleRuleset. However, I think your immediate problem is that you need to call the .new method to create a new instance of a Ruby class:

myschedule=OpenStudio::Model::ScheduleCompact.new(model)
macumber's avatar
12k
macumber
answered 2015-05-22 17:51:17 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks a lot. Where i can find the methods details like: .new(), .get(), .set()?

building_performance's avatar building_performance (2015-05-25 10:53:36 -0500) edit
1

The new method is how you do object instantiation in Ruby, you can ready more about it here. A beginning Ruby tutorial is pretty useful for a place to start. Once you get into the OpenStudio specific stuff the measure writing guide is very helpful.

macumber's avatar macumber (2015-05-25 12:49:46 -0500) edit
add a comment see more comments