Learn R Programming

SpaDES (version 1.0.1)

.simList-class: The simList class

Description

Contains the minimum components of a SpaDES simulation.

Arguments

Accessor Methods

Several slot (and sub-slot) accessor methods are provided for use, and categorized into separate help pages: ll{ simList-accessors-envir Simulation enviroment and objects. simList-accessors-events Scheduled and completed events. simList-accessors-modules Modules loaded and used; module dependencies. simList-accessors-params Global and module-specific parameters. simList-accessors-times Simulation times. }

Event Lists

Event lists are sorted (keyed) by time. Each event is represented by a data.table row consisting of: ll{ eventTime The time the event is to occur. moduleName The module from which the event is taken. eventType A character string for the programmer-defined event type. }

Details

Based on code from chapter 7.8.3 of Matloff (2011): "Discrete event simulation". Here, we implement a discrete event simulation in a more modular fashion so it's easier to add simulation components (i.e., "simulation modules"). We use S4 classes and methods, and use data.table instead of data.frame to implement the event queue (because it is much more efficient). Various slot accessor methods (i.e., get and set functions) are provided (see 'Accessor Methods' below).

References

Matloff, N. (2011). The Art of R Programming (ch. 7.8.3). San Fransisco, CA: No Starch Press, Inc.. Retrieved from http://www.nostarch.com/artofr.htm