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.