A single iterations does the following (in this order):
randomize agent order
go through randomized agents and ... a. re-calculate agent variables (in the order they were added) b. check agent rules (in the order they were added)
re-calculate environment variables (in the order they were added)
check environment rules (in the order they were added)
Usage
tick(.tidyabm, verbose = TRUE, visualize = FALSE, ...)
# S3 method for tidyabm_env
tick(.tidyabm, verbose = TRUE, visualize = FALSE, ...)Arguments
- .tidyabm
the
tidyabm_envobject- verbose
if TRUE (the default), a status message is printed at the end
- visualize
if TRUE, each tick ends with a visualization if this has been implemented for the respective environment; default is FALSE
- ...
further arguments to pass on to visualize
Examples
create_grid_environment(seed = 46444, size = 4) %>%
add_agents(create_agent(), 2) %>%
init() %>%
tick()
#> [1] "Tick 1 finished in 0.002 secs"
#> # A tibble: 1 × 4
#> .tick .runtime .n_agents_after_tick .finished_after_tick
#> * <dbl> <drtn> <int> <lgl>
#> 1 1 0.002215385 secs 2 FALSE
#> # ABM grid environment
#> * 4x4, 2 agents
#> * 0 environment characteristic(s),
#> * 0 environment variable(s),
#> * 0 environment rule(s),
#> * simulating (1 tick(s) passed)