A simple agent-based model simulating ant foraging behavior on a hexagonal grid. Agents (ants) leave the nest to find food, following pheromone trails. When they find food, they return to the nest, depositing a different pheromone to recruit other ants.
- HexGrid: Demonstrates
mesa.discrete_space.HexGrid(toroidal). - PropertyLayer: Uses
mesa.discrete_space.PropertyLayerfor efficient pheromone and resource management (NumPy-backed). - Solara Visualization: Interactive visualization using
SolaraVizandmake_space_component.
To install the dependencies for this example, run:
pip install mesa[rec]To run the visualization:
solara run examples/hex_ant/app.py