mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Proposal: Formal neighborhood definition for grids

Open EwoutH opened this issue 7 months ago • 42 comments

When implementing #1898, I was inherently playing with spaces. A lot of times closeness (as a spatial relationship) is important, and a lot of time, there is a hard cut-off with a binary result: You are either a neighbor or not.

We have a few nice mechanisms built-in the current neighbor logic:

  • moore: If True, return Moore neighborhood (including diagonals) If False, return Von Neumann neighborhood (exclude diagonals)
  • include_center: If True, return the (x, y) cell as well. Otherwise, return surrounding cells only.
  • radius: radius, in cells, of neighborhood to get.

However, it's a bit tedious to pass all those specifications each time you want to use a neighborhood of something. So therefor I would like to have some formal neighborhood specification, so that you can pass one object or variable throughout Mesa and knowing consistently what you need to send and what you get.

EwoutH avatar Dec 06 '23 15:12 EwoutH