module BTAP::SimulationSettings

Public Class Methods

set_run_period(model,start_month,start_day,end_month,end_day, repeat = 1) click to toggle source

This sets the simulation period for the model. All arguments are integers. @author Phylroy A. Lopez @param model [OpenStudio::Model::Model] A model object {openstudio.nrel.gov/latest-c-sdk-documentation/model} @param start_month [Integer] a list of output variables that you wish to report from the simulation. @param start_day [Integer] a list of output variables that you wish to report from the simulation. @param end_month [Integer] a list of output variables that you wish to report from the simulation. @param end_day [Integer] a list of output variables that you wish to report from the simulation. @param repeat [Integer = 1] Number of times the simulation period is run. 1 is default. @return [OpenStudio::Model::Model] the OpenStudio model object (self reference).

# File lib/openstudio-standards/btap/btap.rb, line 189
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