Ant Foraging

Ants with no map and no leader build efficient trails to food, purely through pheromone.

Animation of the Ant Foraging model running in Stigmery

Introduction

Each ant follows two simple drives: wander in search of food, and once carrying a crumb, head back to the nest while laying a pheromone trail. Other ants smell that pheromone and tend to follow it, which reinforces good routes. Sharp foraging trails emerge even though no ant ever sees the whole picture.

Background

This is the textbook demonstration of stigmergy, the term Pierre-Paul Grasse coined in 1959 for coordination through traces left in the environment rather than direct messages between agents. The pheromone-trail mechanism was later measured in real ants and formalised as a model of self-organised foraging.

Deneubourg, J.-L., Aron, S., Goss, S., & Pasteels, J. M. (1990). The self-organizing exploratory pattern of the Argentine ant. Journal of Insect Behavior, 3(2), 159-168.

How it works

  1. If not carrying food, follow the food-pheromone gradient when there is one, otherwise wander.
  2. On reaching food, pick up a crumb and turn back toward the nest.
  3. While carrying food, drop pheromone each step so the return route is marked.
  4. Back at the nest, drop the food and start searching again.
  5. Every tick the pheromone field evaporates a little and diffuses outward, so unused trails fade.

Parameters

population
How many ants forage at once. More ants discover and reinforce trails faster.
evaporation
How much pheromone survives each tick. Low values keep trails faint and exploratory; high values lock routes in.
diffusion
How far pheromone spreads to neighbouring cells, widening trails into gradients ants can follow.
pheromone_drop
How much scent an ant lays per step while carrying food. More scent makes stronger, stickier trails.

Open this model in the editor →

Related models