Learn R Programming

SpaDES (version 1.0.1)

times: Get and set simulation times.

Description

Accessor functions for the simtimes slot of a simList object and its elements. To maintain modularity, the behavior of these functions depends on where they are used.

Usage

times(x, ...)

## S3 method for class 'simList':
times(x)

times(x) <- value

## S3 method for class 'simList':
times(x) <- value

time(x, unit, ...)

## S3 method for class 'simList,missing':
time(x)

## S3 method for class 'simList,character':
time(x, unit)

time(x) <- value

## S3 method for class 'simList':
time(x) <- value

end(x, unit, ...)

## S3 method for class 'simList,missing':
end(x)

## S3 method for class 'simList,character':
end(x, unit)

end(x) <- value

## S3 method for class 'simList':
end(x) <- value

start(x, unit, ...)

## S3 method for class 'simList,missing':
start(x)

## S3 method for class 'simList,character':
start(x, unit)

start(x) <- value

## S3 method for class 'simList':
start(x) <- value

.callingFrameTimeunit(x)

## S3 method for class 'simList':
.callingFrameTimeunit(x)

## S3 method for class '`NULL`':
.callingFrameTimeunit(x)

timeunit(x)

## S3 method for class 'simList':
timeunit(x)

timeunit(x) <- value

## S3 method for class 'simList':
timeunit(x) <- value

timeunits(x)

## S3 method for class 'simList':
timeunits(x)

Arguments

x
A simList simulation object.
...
Additional parameters.
value
The object to be stored at the slot.
unit
Character. One of the time units used in SpaDES.

Value

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

Details

NOTE: These have default behavior that is based on the calling frame timeunit. When used inside a module, then the time is in the units of the module. If used in an interactive mode, then the time will be in the units of the spades simulation. Additonal methods are provided to access the current, start, and end times of the simulation: ll{ time Current simulation time. start Simulation start time. end Simulation end time. timeunit Simulation timeunit. times List of all simulation times (current, start, end, timeunit). } timeunit will extract the current units of the time used in a spades call. If it is set within a simInit, e.g., times=list(start=0, end=52, timeunit="week"), it will set the units for that simulation. By default, a simInit call will use the smallest unit contained within the metadata for the modules being used. If NA, timeunit defaults to none. timeunits will extract the current units of the time of all modules used in a simulation. This is different from timeunit because it is not necessarily associated with a spades call.

See Also

simList-class, simList-accessors-envir, simList-accessors-modules, simList-accessors-params, simList-accessors-events.