class URBANopt::Scenario::ScenarioBase

ScenarioBase is a simulation method agnostic description of a Scenario.

Public Class Methods

new(name, root_dir, run_dir, feature_file) click to toggle source

Initialize ScenarioBase attributes: name , +root directory+ , +run directory+ and feature_file

parameters:
  • name - String - Human readable scenario name.

  • root_dir - String - Root directory for the scenario, contains Gemfile describing dependencies.

  • run_dir - String - Directory for simulation of this scenario, deleting run directory clears the scenario.

  • feature_file - FeatureFile - An instance of URBANopt::Core::FeatureFile containing features for simulation.

# File lib/urbanopt/scenario/scenario_base.rb, line 18
def initialize(name, root_dir, run_dir, feature_file)
  @name = name
  @root_dir = root_dir
  @run_dir = run_dir
  @feature_file = feature_file
end

Public Instance Methods

clear() click to toggle source

Removes all simulation input and output files by removing this Scenario's run_dir .

# File lib/urbanopt/scenario/scenario_base.rb, line 47
def clear
  Dir.glob(File.join(@run_dir, '/*')).each do |f|
    FileUtils.rm_rf(f)
  end
end
simulation_dirs() click to toggle source

An array of SimulationDirBase objects.

# File lib/urbanopt/scenario/scenario_base.rb, line 42
def simulation_dirs
  raise 'simulation_dirs not implemented for ScenarioBase, override in your class'
end