View source: R/trajectory-activities.R
handle_unfinished | R Documentation |
Activity for setting a drop-out trajectory for unfinished arrivals, i.e.,
those dropped from a resource (due to preemption, resource shrinkage or a
rejected seize
) or those that leave
a trajectory.
handle_unfinished(.trj, handler, ..., tag)
.trj |
the trajectory object. |
handler |
trajectory object to handle unfinished arrivals. A |
... |
unused. |
tag |
activity tag name to perform named rollbacks (see
|
Returns the trajectory object.
leave
, set_capacity
traj <- trajectory() %>%
log_("arrived") %>%
handle_unfinished(
trajectory() %>%
log_("preempted!")) %>%
seize("res") %>%
log_("resource seized") %>%
timeout(10) %>%
release("res") %>%
log_("leaving")
simmer() %>%
add_resource("res", 1, 0, preemptive=TRUE, queue_size_strict=TRUE) %>%
add_generator("dummy", traj, at(0)) %>%
add_generator("priority_dummy", traj, at(5), priority=1) %>%
run() %>% invisible
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.