Example:
library(simmer)
t1 <- trajectory() %>%
set_attribute("index", 1) %>%
clone(
n = 2,
trajectory("Original") %>%
set_attribute("index", function() get_attribute(env, "index") + 1),
trajectory("MW") %>%
timeout(1) %>%
set_attribute("index", function() get_attribute(env, "index") + 1)
) %>%
synchronize(wait = TRUE, mon_all = FALSE)
env <- simmer() %>%
add_generator("asdf", t1, at(0), mon=2)
env %>%
run() %>%
get_mon_attributes()
#> time name key value replication
#> 1 0 asdf0 index 1 1
#> 2 0 asdf0 index 2 1
#> 3 1 asdf0 index NA 1
NA should be 2.
Example:
NAshould be2.