🦠 Slime Mold Simulation

Physarum polycephalum. Particles deposit a chemical trail and steer towards where it is strongest, forming organic transport networks.

Checking...
The science

Agents follow the model of Jones (2010), inspired by Physarum polycephalum. Each agent senses the pheromone field at three points a distance d ahead (left, centre, right, at ±θ), turns toward the strongest and moves a fixed step v = 2 cells, depositing pheromone 1. The field then diffuses with a 3x3 box filter and decays: c' = λ · box3(c).

Two exact properties are tested on load: (1) filter + decay keeps total mass Σc' = λ Σc away from the edges; (2) each blur step adds variance 2/3 cell² per axis, so σ² = 2n/3 after n steps.

Simplifications: a discrete grid (2 px per cell), one pheromone species, no food sources or cytoplasm flow. Real slime moulds solve path problems by thickening tubes, not only by following trails. Click and drag to lay pheromone.