đ Stigmergy Swarm â Collective Intelligence Through Pheromone Trails¶
This simulation demonstrates stigmergy: agents that communicate indirectly through modifications of their shared environment.
Ant-like agents search for food on a 2D grid. When an agent finds food it carries a unit back to the nest, depositing pheromone along the way. Other agents are probabilistically attracted toward higher pheromone concentrations â so successful paths get reinforced automatically.
No agent has any global knowledge. Yet over time the swarm converges on efficient routes from nest to food.
đ§ Key Concepts¶
- Stigmergy â indirect coordination via environmental traces
- Self-organization â global structure from local rules
- Positive feedback â successful paths attract more traffic
- Evaporation â unused paths decay, preventing lock-in
đŧ Visualisation¶
The matplotlib window shows:
- Background heatmap â pheromone concentration (log-scaled)
- Green diamonds â active food sources
- Blue square â nest
- White dots â searching agents
- Red dots â agents carrying food back to nest
Press ESC to stop the simulation.