View source: R/trajectory-activities.R
set_prioritization | R Documentation |
Activity for dynamically modifying an arrival's prioritization values.
Default prioritization values are defined by the source (see
add_generator
, add_dataframe
).
set_prioritization(.trj, values, mod = c(NA, "+", "*"), ..., tag)
.trj |
the trajectory object. |
values |
expects either a vector/list or a callable object (a function)
returning a vector/list of three values |
mod |
if set, |
... |
unused. |
tag |
activity tag name to perform named rollbacks (see
|
Returns the trajectory object.
get_prioritization
traj <- trajectory() %>%
# static values
set_prioritization(c(3, 7, TRUE)) %>%
# increment
set_prioritization(c(2, 1, 0), mod="+") %>%
# dynamic, custom
set_attribute("priority", 3) %>%
set_prioritization(function() {
prio <- get_prioritization(env)
attr <- get_attribute(env, "priority")
c(attr, prio[[2]]+1, FALSE)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.