Skip to main content

Module grid

Module grid 

Source
Expand description

2D grid spaces with integer coordinates.

Two variants are provided:

  • Grid2D - multi-occupancy: each cell can hold any number of agents.
  • Grid2DSingle - single-occupancy: each cell holds at most one agent.

Both support periodic (toroidal) and non-periodic (bounded) boundaries. Neighbor queries use Chebyshev distance (8-connected / square neighborhood).

Mirrors Julia Agents.jl GridSpace and GridSpaceSingle.

Structs§

Grid2D
Multi-occupancy 2D grid space.
Grid2DSingle
Single-occupancy 2D grid space.

Enums§

GridError
Errors returned by grid space operations.

Type Aliases§

GridPos2
Position on a 2D grid: (x, y) with 0 ? x < width, 0 ? y < height.