Creates a new event in R
an external pointer, which can then be passed to functions such as schedule and unschedule.
the time that this event will occur. A length-1 numeric vector.
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.