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)

Arguments

.trj

the trajectory object.

handler

trajectory object to handle unfinished arrivals. A NULL value will unset the drop-out trajectory.

Value

Returns the trajectory object.

See also

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