visit | R Documentation |
These bricks encapsulate a resource visit: seize, spend some time and release.
visit(.trj, resource, task, amount = 1)
visit_selected(.trj, task, amount = 1, id = 0)
.trj |
the trajectory object. |
resource |
the name of the resource. |
task |
the timeout duration supplied by either passing a numeric or a callable object (a function) which must return a numeric (negative values are automatically coerced to positive). |
amount |
the amount to seize/release, accepts either a numeric or a callable object (a function) which must return a numeric. |
id |
selection identifier for nested usage. |
Returns the following chain of activities: seize
> timeout
> release
(see examples below).
## These are equivalent:
trajectory() %>%
visit("res", 5, 1)
trajectory() %>%
seize("res", 1) %>%
timeout(5) %>%
release("res", 1)
## These are equivalent:
trajectory() %>%
visit_selected(5, 1)
trajectory() %>%
seize_selected(1) %>%
timeout(5) %>%
release_selected(1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.