Skip to contents

Creates an environment with a specified two-dimensional grid. Either define the grid as a square by setting one side's size or define the grid as a rectangle by setting both x and y.

The seed is used to explicitly document random-number generation initiation in your script.

Usage

create_grid_environment(seed, size = NULL, x = NULL, y = NULL)

Arguments

seed

a single number (integer) to initiate random-number generation

size

number to indicate side length for square

x

numeric side length of side x (omitted if size is set)

y

numeric side length of side y (omitted if size is set)

Value

tidyabm object

Examples

create_grid_environment(seed = 42, size = 25)
#> # A tibble: 0 × 0
#> # ABM grid environment
#> * 25x25, 0 agents
#> * 0 environment characteristic(s), 
#> * 0 environment variable(s), 
#> * 0 environment rule(s), 
#> * not initiated

create_grid_environment(seed = 123, x = 25, y = 5)
#> # A tibble: 0 × 0
#> # ABM grid environment
#> * 25x5, 0 agents
#> * 0 environment characteristic(s), 
#> * 0 environment variable(s), 
#> * 0 environment rule(s), 
#> * not initiated