Class: URBANopt::Scenario::SimulationDirBase

Inherits:
Object
  • Object
show all
Defined in:
lib/urbanopt/scenario/simulation_dir_base.rb

Direct Known Subclasses

SimulationDirOSW

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scenario, features, feature_names) ⇒ SimulationDirBase

SimulationDirBase is the agnostic representation of a directory of simulation input files.

parameters:
  • scenario - ScenarioBase - Scenario containing this SimulationDirBase.

  • features - Array - Array of Features that this SimulationDirBase represents.

  • feature_names - Array - Array of scenario specific names for these Features.



51
52
53
54
55
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 51

def initialize(scenario, features, feature_names)
  @scenario = scenario
  @features = features
  @feature_names = feature_names
end

Instance Attribute Details

#feature_namesObject (readonly)

:nodoc:



61
62
63
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 61

def feature_names
  @feature_names
end

#featuresObject (readonly)

:nodoc:



59
60
61
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 59

def features
  @features
end

#scenarioObject (readonly)

:nodoc:



57
58
59
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 57

def scenario
  @scenario
end

Instance Method Details

#clearObject

Clear the directory that this simulation runs in



88
89
90
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 88

def clear
  raise 'clear is not implemented for SimulationFileBase, override in your class'
end

#create_input_filesObject

Create run directory and generate simulation inputs, all previous contents of directory are removed



95
96
97
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 95

def create_input_files
  raise 'create_input_files is not implemented for SimulationFileBase, override in your class'
end

#out_of_date?Boolean

Return true if the simulation is out of date (input files newer than results), false otherwise. Non-existant simulation input files are out of date.

Returns:

  • (Boolean)


74
75
76
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 74

def out_of_date?
  raise 'out_of_date? is not implemented for SimulationFileBase, override in your class'
end

#run_dirObject

Return the directory that this simulation will run in



66
67
68
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 66

def run_dir
  raise 'run_dir is not implemented for SimulationFileBase, override in your class'
end

#simulation_statusObject

Returns simulation status one of Started’, ‘Started’, ‘Complete’, ‘Failed’



81
82
83
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 81

def simulation_status
  raise 'simulation_status is not implemented for SimulationFileBase, override in your class'
end