Provides methods for evaluating event occurrences. The event mechanism should only be evaluated by the simulator.
Object of R6Class Event, with methods to get/set the internal parameter values and to evaluate the event mechanism.
descriptionA character string giving a more descriptive overview of the event's role.
new()Create a new Event object.
Event$new( name, description = "", parameters = list(), derived = list(), allocated = list(), mechanism )
nameA character string giving the name of the event. Must be unique.
descriptionA character string giving a more descriptive overview of the event's role.
parametersA named list giving the initial parameter values of the event.
derivedA list of expression that define additional parameters based on those in parameters.
If given, then parameters should be named, so its elements can be referenced by elements of derived.
allocatedA named list of expression that define objects that persist between iterations,
for example to avoid memory reallocation. The initial status of the simulator can be referenced by these expressions, a
s well as any parameters or derived parameters of the event itself.
mechanismAn expression that defines the event functionality.
apply()Apply an event. Not defined for the superclass.
Event$apply()
allocate()Allocates persistent objects for the event.
Event$allocate(status)
statusThe initial status of the Simulator.
set_parameters()Set the parameter values of the event. Derived parameters are computed again based on the new values.
Event$set_parameters(pars)
parsA named list where where the names correspond to the names of the parameters of whose values are to be set.
get_parameters()Get the current parameter values.
Event$get_parameters(derived = TRUE)
derivedA logical value. If TRUE (the default), the derived parameters are also returned.
A list of the current parameter values.
set_id()Assing an identifier for the event. Should not be called by the user directly.
Event$set_id(id)
idAn integer identifier to set.
get_id()Get the event identifier
Event$get_id()
get_name()Get the name of the event
Event$get_name()
clone()The objects of this class are cloneable with this method.
Event$clone(deep = FALSE)
deepWhether to make a deep clone.