Skip to contents

Get a tibble of direct neighbors

Usage

grid_get_neighbors(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 neighbors surrounding me (default)

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

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

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

Value

a tibble of neighboring agents in no particular order with their characteristics and variables set