Get a tibble with two columns (.x and .y) of neighboring free spots
Source:R/environment_grid.r
grid_get_free_neighboring_spots.RdGet a tibble with two columns (.x and .y) of neighboring free spots
Arguments
- agent
the agent for whom the neighbors should be collected (
me)- abm
the whole environment model
- which
one of the following:
oto get up to 8 neighboring spots surroundingme(default)+to get up to 4 neighboring spots directly next tome(no diagonals)-to get up to 2 x-axis neighboring spots, one on each side ofme|to get up to 2 y-axis neighboring spots, one above and one belowme
Value
a tibble of neighboring spots (with a .x and a .y column) in
no particular order that are free
See also
Other utilities:
get_characteristic(),
get_random_agent(),
get_variable(),
grid_get_free_spots(),
grid_get_neighbors(),
grid_move(),
network_connect(),
network_get_neighbors(),
network_spread(),
remove_agent(),
stop_abm()