Skip to contents

A single iterations does the following (in this order):

  1. randomize agent order

  2. 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)

  3. re-calculate environment variables (in the order they were added)

  4. 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_env object

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

Value

a tidyabm_env object

See also

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)