Skip to contents

Get a tibble with two columns (.x and .y) of neighboring free spots

Usage

grid_get_free_neighboring_spots(agent, abm, which = "o")

Arguments

agent

the agent for whom the neighbors should be collected (me)

abm

the whole environment model

which

one of the following:

  • o to get up to 8 neighboring spots surrounding me (default)

  • + to get up to 4 neighboring spots directly next to me (no diagonals)

  • - to get up to 2 x-axis neighboring spots, one on each side of me

  • | to get up to 2 y-axis neighboring spots, one above and one below me

Value

a tibble of neighboring spots (with a .x and a .y column) in no particular order that are free