How to add fractional type Schedule using Openstudio SDK

asked 2023-02-23 05:10:01 -0500

Rocker's avatar

updated 2023-02-23 09:18:02 -0500

This the code snippet I am using to set a schedule where my requirement is a fractional type schedule but it auto sets it as dimensionless

new_schedule = os.model.ScheduleRuleset(model1)
new_schedule.setName("New Schedule")
schedule_limits = os.model.ScheduleTypeLimits(model1)
schedule_limits.setName("New Schedule Type Limits")
schedule_limits.setUnitType("Fractional")
display=schedule_limits.unitType()
print(display)
schedule_limits.setLowerLimitValue(0.0)
schedule_limits.setUpperLimitValue(1.0)
new_schedule.setScheduleTypeLimits(schedule_limits)
hourly_values = [0.0] * 24
hourly_values[8:18] = [1.0] * 10 
schedule_day = os.model.ScheduleDay(model1,24) 
schedule_day.values = hourly_values
print(schedule_day.values)

Thanks

edit retag flag offensive close merge delete

Comments

Is there any solution

Rocker's avatar Rocker  ( 2023-02-24 06:35:38 -0500 )edit

One thing i have observed that it sets the type to whatever is written here schedule_limits.setName("New Schedule Type Limits") So if i export the file to osm type and open it again using openstudio application the schedule type is displayed (New Schedule Type Limits)

Rocker's avatar Rocker  ( 2023-02-24 06:38:13 -0500 )edit