Last chance! 50% off unlimited learning
Sale ends in
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)
Returns the trajectory object.
the trajectory object.
trajectory object to handle unfinished arrivals. A NULL
value will unset the drop-out trajectory.
unused.
activity tag name to perform named rollbacks (see
rollback
) or just to better identify your activities.
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
Run the code above in your browser using DataLab