API Reference

pyLEAFS: Layered Environment with Agents Foraging Simulator.

A dimension-agnostic (2d or 3d) agent-based foraging model built on a struct-of-arrays NumPy layout. The first version is a single-species greedy forager on a replenishing Poisson resource field; later layers (pheromone fields, predators, heterogeneous environments, neuroevolution) attach through the extension seams in the core.

Modules

grid

Shared Grid: region partition, toroidal Moore neighbours, coordinate maps.

fields

Field protocol and ResourceField (Poisson birth / Binomial death).

spatialhash

Generic SpatialHash over any (n, D) point set.

population

Greedy forager Population (struct-of-arrays bodies, metabolism, budding).

simulation

Multi-population step loop and parameter factories.

viewer

Interactive matplotlib viewer (pause, add agents, inspect).

palette

Named RGB colours for LEAFS visualisation.