Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

How to create a new compact schedule by measure?

asked 2015-05-18 12:30:19 -0600

building_performance's avatar

updated 2017-08-05 13:25:14 -0600

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2015-05-18 15:48:54 -0600

updated 2015-05-18 15:50:31 -0600

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

edit flag offensive delete link more
2

answered 2015-05-22 17:51:17 -0600

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)
edit flag offensive delete link more

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 -0600 )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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2015-05-18 12:30:19 -0600

Seen: 695 times

Last updated: May 22 '15