Ant Trails

A small agent simulation. Each ant follows a few local rules — follow scent, carry food home, leave scent on the way — and trails appear without any ant planning them.

Watch simple ants find food and lay scent trails — then change the map and the evaporation and compare.

FreeOn this device

Cursor: column 33, row 21 — scent 0.00. Blue square nest, amber food, grey walls, white ants (yellow when carrying).

An illustrative model with made-up rules — not a description of how real ants behave.

Tick 0 · delivered 0 · carrying 0 · food left 60 · paused.

Controls

  • Play, Pause and Step run the colony; Restart starts the current map again.
  • Choose Nest, Food, Wall or Erase and tap the map — or Tab to the map, move the cursor with the arrow keys and press Enter. Editing pauses and restarts the run.
  • Evaporation sets how fast scent fades. Compare runs the same seed at two rates and charts deliveries.

The rules

  • Each tick an ant chooses between the free cells ahead, ahead-left and ahead-right, favouring stronger scent; one time in ten it picks at random.
  • An ant carrying food also leans towards the nest and leaves scent behind it. Food is taken one unit at a time and delivered once at the nest.
  • Scent fades by the evaporation rate every tick and 5% spreads to each side neighbour. It never goes below zero or into walls.

Scoring, saving and limits

No score. The status line counts deliveries; the chart compares two settings on the same seed.

Your map and evaporation setting are kept on this device. A run itself restarts on reload — the same map and settings replay identically.

An illustrative model with invented rules, not a claim about real ant behaviour. At most 200 ants. The Empty larder scenario has no food on purpose: the ants simply explore.

Questions

Why do trails form at all?
Ants returning with food leave scent, and other ants prefer stronger scent, so a successful route gets reinforced while unused ones fade.
What does evaporation change?
Slow evaporation keeps old trails around longer (sometimes too long); fast evaporation makes the colony forget quickly.
Is it random?
Each scenario has a fixed seed, so a run is repeatable — change a setting and you see only the effect of that change.