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.
Arguments
- .trj
the trajectory object.
- handler
trajectory object to handle unfinished arrivals. A
NULL
value will unset the drop-out trajectory.- ...
unused.
- tag
activity tag name to perform named rollbacks (see
rollback
) or just to better identify your activities.
Examples
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
#> 0: dummy0: arrived
#> 0: dummy0: resource seized
#> 5: priority_dummy0: arrived
#> 5: priority_dummy0: resource seized
#> 5: dummy0: preempted!
#> 15: priority_dummy0: leaving