SpaDES (version 1.1.4)

params: Get and set simulation parameters.

Description

Accessor functions for the params slot of a simList object and its elements. Additonal methods are provided to access core module and global parameters: Commonly used ll{ globals List of global simulation parameters. params Nested list of all simulation parameters. } Advanced use lll{ Accessor method Module Description checkpointFile .checkpoint Name of the checkpoint file. (advanced) checkpointInterval .checkpoint The simulation checkpoint interval. (advanced) progressType .progress Type of graphical progress bar used. (advanced) progressInterval .progress Interval for the progress bar. (advanced) }

Usage

params(object)

## S3 method for class '.simList': params(object)

params(object) <- value

## S3 method for class '.simList': params(object) <- value

globals(object)

## S3 method for class '.simList': globals(object)

globals(object) <- value

## S3 method for class '.simList': globals(object) <- value

checkpointFile(object)

## S3 method for class '.simList': checkpointFile(object)

checkpointFile(object) <- value

## S3 method for class '.simList': checkpointFile(object) <- value

checkpointInterval(object)

## S3 method for class '.simList': checkpointInterval(object)

checkpointInterval(object) <- value

## S3 method for class '.simList': checkpointInterval(object) <- value

progressInterval(object)

## S3 method for class '.simList': progressInterval(object)

progressInterval(object) <- value

## S3 method for class '.simList': progressInterval(object) <- value

progressType(object)

## S3 method for class '.simList': progressType(object)

progressType(object) <- value

## S3 method for class '.simList': progressType(object) <- value

Arguments

object
A simList simulation object.
value
The object to be stored at the slot.

Value

  • Returns or sets the value of the slot from the simList object.

Details

Currently, only get and set methods are defined. Subset methods are not.

Progress Bar: Progress type can be "text", "graphical" or "shiny". Progress interval can be a numeric. These both can get set by passing a .progress=list(type="graphical", interval=1) into the simInit call. See examples

See Also

simList-class, simList-accessors-envir, simList-accessors-events, simList-accessors-inout, simList-accessors-modules, simList-accessors-objects, simList-accessors-paths, simList-accessors-times.

Examples

Run this code
mySim <- simInit(times=list(start=0.0, end=100.0),
                 params=list(.globals=list(stackName="landscape"),
                             .progress=list(type="text", interval=10),
                             .checkpoint = list(interval = 10, file = "chkpnt.RData")),
                 modules=list("randomLandscapes"),
                 paths=list(modulePath=system.file("sampleModules", package="SpaDES")))

# progress bar
progressType(mySim) # "text"
progressInterval(mySim) # 10

# parameters
params(mySim) # returns all parameters in all modules
              # including .global, .progress, .checkpoint
globals(mySim) # returns only global parameters

# checkpoint
checkpointFile(mySim) # returns the name of the checkpoint file
                      # In this example, "chkpnt.RData"
checkpointInterval(mySim) # 10

Run the code above in your browser using DataLab