Activities for seizing/releasing a resource, by name or a previously selected one.
seize(.trj, resource, amount = 1, continue = NULL, post.seize = NULL,
reject = NULL)seize_selected(.trj, amount = 1, id = 0, continue = NULL,
post.seize = NULL, reject = NULL)
release(.trj, resource, amount = 1)
release_selected(.trj, amount = 1, id = 0)
release_all(.trj, resource)
release_selected_all(.trj, id = 0)
the trajectory object.
the name of the resource.
the amount to seize/release, accepts either a numeric or a callable object (a function) which must return a numeric.
a boolean (if post.seize
OR reject
is defined)
or a pair of booleans (if post.seize
AND reject
are defined; if
only one value is provided, it will be recycled) to indicate whether these
subtrajectories should continue to the next activity in the main trajectory.
an optional trajectory object which will be followed after a successful seize.
an optional trajectory object which will be followed if the
arrival is rejected. Note that if the arrival is accepted (either in the
queue or in the server) and then it is dropped afterwards due to preemption
or resource shrinkage, then this trajectory won't be executed. Instead, see
handle_unfinished
for another, more general, method for
handling all kinds of unfinished arrivals.
selection identifier for nested usage.
Returns the trajectory object.
select
, set_capacity
, set_queue_size
,
set_capacity_selected
, set_queue_size_selected
.