newEvent | R Documentation |
Creates a new event in R
time |
the time that this event will occur. A length-1 numeric vector. |
handler |
an R function that handles the event when it occurs. |
The R handler function should take exactly 3 arguments
time: the current time in the simulation
sim: the simulation object, an external pointer
agent: the agent to whom this event is attached to.
The return value of the handler function is ignored.
This function avoids the overhead of an R6 class, and is thus faster. This is the recommended method to create an event in an event handler.
an external pointer, which can then be passed to functions such as schedule and unschedule.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.