Description Format Construction Active Field (read-only) Public Methods Examples
Target
is to be used within TransitionClassification
or supply to event
functions. If the target is dynamic then its get
will return its target
value at the current time or its closest time to the current time.
R6::R6Class object inheriting Generic.
1 |
x
:: any object that passes check_target()
A target object or NULL
.
data
:: a target object
A target object.
dynamic
:: logical(1)
A logical flag which indicates whether the target object is dynamic or not.
get(time = .get_sim_time())
(integer(1)
) -> a named list()
Get an alignment target as a named list. Note that, all the elements in the list
will be scaled by multiplying with the value stored in getOption("dymium.simulation_scale")
and all the values in the output are rounded to their nearest integers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # static target
TrgtStatic <- Target$new(x = list(yes = 10))
TrgtStatic$data
TrgtStatic$dynamic
TrgtStatic$get()
# dynamic target
target_dynamic <- data.frame(time = 1:10, yes = 1:10)
TrgtDynamic <- Target$new(x = target_dynamic)
TrgtDynamic$data
TrgtDynamic$dynamic
# if the `time` argument in `get()` is not specified then it will rely on
# the time step from the simulation clock from `.get_sim_time()`.
TrgtDynamic$get()
TrgtDynamic$get(1)
TrgtDynamic$get(10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.