Ant Colony Pheromone Trails (2D)
Watch a colony converge on the shorter of two barrier gaps between nest and food through nothing but pheromone deposit and evaporation — no ant ever measures a distance.
This 2D companion turns the ant colony into a real stigmergy simulation: ants leave the nest, wander with a pheromone-biased random walk, and once they reach the food they head straight home while laying a strong trail behind them. A wall with two gaps of different length separates nest and food, so the colony faces the classic "double bridge" choice — and because trips through the shorter gap complete faster, that gap's trail builds up before it can evaporate, pulling more ants onto it in a self-reinforcing loop.
Pheromone deposit and exponential evaporation on a grid, with ants steering probabilistically toward the strongest nearby trail — the same stigmergic feedback loop real ant colonies use to find efficient foraging routes.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
Because ants that use the shorter gap return to the nest sooner, they lay pheromone there more often per unit time than ants using the longer gap. Since pheromone also evaporates, the shorter route's trail strength pulls ahead and keeps attracting more foragers — a positive feedback loop with no central coordination.
A faster decay prunes weak trails quickly, so only the most frequently reinforced path survives — the colony converges faster but is more likely to abandon a route if traffic on it briefly drops.
Yes — the deposit/evaporate/probabilistic-steering loop here is the core mechanism behind Ant Colony Optimization, a real metaheuristic used for routing and scheduling problems, simplified here to a 2D foraging field you can watch converge in real time.