knitr::opts_chunk$set(cache = TRUE, echo = TRUE, eval = FALSE)

SpaDES

Spatial Discrete Event Simulator

Other DESs

Events

Modules

Modules and Modularity

SpaDES is implemented in a way that facilitates modularity of code:

Thus, modules can be added, removed, or swapped out without needing to recode the rest of the model.

Module types

Once we see that a module is just a convenient way to group together events, anything can be a module. Can be a single line of code or as many as you want.

Agent-based modules

Raster module

Data preparation module

Why use a SpaDES module

... instead of just an R script or function?

Anatomy of a module

A module is an R script with 3 parts:

  1. Metadata - a list of 15 things

    • Name, Author, Description, other for human reader
    • parameters, input objects, output objects for R to "understand"
  2. doEvent - 2 types of things here

    • schedule events
    • run functions
  3. Anything else

    • custom functions
    • initial data preparation steps

Running SpaDES

Essentially 2 steps

  1. Create a simList using simInit()
  2. Run spades()

All the necessary information is contained within the simList

What might be needed for a DES to run...

What is in the simList

- start and stop times
- data
- paths
- which modules to use
- parameters
- a schedule of events
- outputs

Data

Data challenges

Numerous challenges exist with data

SpaDES doesn't necessarily solve these issues, but in some cases it helps.

Where to get help

?SpaDES


PredictiveEcology/SpaDES.Workshops documentation built on Jan. 30, 2021, 6:52 p.m.