Where does simList come from?

  1. Initializing a simulation using simInit() creates a simList object.

  2. Running a simulation via a spades() call returns a modified simList object.

How are simulations specified?

A simList object is simply a structured data type containing various elements of a simulation.

The main components of a simList are:

  1. A list of modules used;
  2. The event queue;
  3. A description of the data (object) dependencies.

How SpaDES works: simLists

We can examine the simList object structure in the usual R fashion by printing (showing) it, or by using str():

NOTE: simLists are S4 objects, so we can use getSlots() and slotNames() to examine the object.

See also ?'.simList-class'

Accessing the parts of a simLists

## Setting:
##   options(
##     rasterTmpDir = 'C:/Users/Ceres Barros/AppData/Local/Temp/Rtmp6t5nvX/raster'
##     reproducible.cachePath = 'C:/Users/Ceres Barros/AppData/Local/Temp/Rtmp6t5nvX/reproducible/cache'
##     spades.inputPath = 'C:/Users/Ceres Barros/AppData/Local/Temp/RtmpYTlZF7/SpaDES/inputs'
##     spades.outputPath = 'C:/Users/Ceres Barros/AppData/Local/Temp/RtmpYTlZF7/SpaDES/outputs'
##     spades.modulePath = 'C:/Users/Ceres Barros/AppData/Local/Temp/RtmpYTlZF7/SpaDES/modules'
##   )
slot accessor
modules modules()
params params()
events events()
current current()
completed completed()
depends depends()
simtimes times()
inputs inputs()
outputs outputs()
paths paths()
.envir envir()
.xData objects()
other_accessors
packages()
globals()
start()
end()
timeunit()
timeunits()
paths()
cachePath()
inputPath()
outputPath()
modulePath()

Model specification

Simple examples (using demo modules) of simInit() and spades() calls.

  • examine simList structure before and after the spades() call

Initiliaze an empty simList object

Inspect the empty simList object

  1. What are the names of each of the slots in the simList?
  2. What do each of these slots contain? Hint: see ?'.simList-class'.

Inspect the new simList object

Use the simList accessor functions to determine the following:

  1. the modules included in the simulation and their package dependencies;
  2. the global parameter values used;
  3. the module-specific parameter values used;
  4. the simulation start and end times;
  5. the timeunits used by the modules in the simulation;
  6. the scheduled and completed event queues;
  7. the objects (functions, data, etc.) used in the simulation;
  8. the file paths used for simulation inputs and outputs.

Compare the simList before and after