Module: BTAP::SimulationSettings
- Defined in:
- lib/openstudio-standards/btap/btap.rb
Class Method Summary collapse
-
.set_run_period(model, start_month, start_day, end_month, end_day, repeat = 1) ⇒ OpenStudio::Model::Model
This sets the simulation period for the model.
Class Method Details
.set_run_period(model, start_month, start_day, end_month, end_day, repeat = 1) ⇒ OpenStudio::Model::Model
This sets the simulation period for the model. All arguments are integers.
195 196 197 198 199 200 201 202 203 204 |
# File 'lib/openstudio-standards/btap/btap.rb', line 195 def self.set_run_period(model,start_month,start_day,end_month,end_day, repeat = 1) raise("Run Period is invalid") unless Date.valid_civil?(2001, start_month , start_day) and Date.valid_civil?(2001, end_month , end_day) and repeat > 0 run_period = model.getRunPeriod run_period.setBeginMonth(start_month) run_period.setBeginDayOfMonth(start_day) run_period.setEndMonth(end_month) run_period.setEndDayOfMonth(end_day) run_period.setNumTimePeriodRepeats(repeat) return model end |