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.



41
42
43
44
45
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 41

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

Instance Attribute Details

#feature_namesObject (readonly)

:nodoc:



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

def feature_names
  @feature_names
end

#featuresObject (readonly)

:nodoc:



49
50
51
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 49

def features
  @features
end

#scenarioObject (readonly)

:nodoc:



47
48
49
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 47

def scenario
  @scenario
end

Instance Method Details

#clearObject

Clear the directory that this simulation runs in



78
79
80
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 78

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



85
86
87
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 85

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)


64
65
66
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 64

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



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

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’



71
72
73
# File 'lib/urbanopt/scenario/simulation_dir_base.rb', line 71

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