Physarum Slime (Agents)

Thousands of agents wander on a grid while reading a chemoattractant trail field. Each agent has three sensors — left, centre, and right of its heading — and turns toward whichever sensor reads the strongest concentration. Wherever an agent walks it deposits trail; the trail field then diffuses to its neighbours and decays exponentially every step. This minimal sense → steer → deposit → diffuse → decay loop, popularised by Jeff Jones to model Physarum polycephalum, self-organises into branching transport networks reminiscent of slime-mold foraging behaviour.

Who it's for: Intro complex systems, swarm intelligence, and computational biology; great for showing how local rules generate global structure.

Key terms

  • Physarum polycephalum
  • agent-based model
  • chemotaxis
  • reaction–diffusion
  • self-organisation
  • transport networks

How it works

Thousands of agents wander, **deposit a trail**, and **steer toward** local chemoattractant. With three forward-leaning sensors and turning rules, ant-like and fungal **path networks** emerge spontaneously.

Key equations

pos ← pos + v · (cos θ, sin θ)
C(x, y) ← (1 − ρ) · ∇²-blur(C + dep) (decay + diffuse)

Frequently asked questions

What controls whether the network is dense or sparse?
The deposit rate, the trail decay, and the sensor angle/distance compete. Strong deposit + slow decay reinforce existing paths and tighten them into thick veins; faster decay or wider sensor angles encourage agents to keep exploring, producing a thinner, more diffuse network.
Is this an actual biological model?
It is inspired by Physarum but is intentionally a minimal toy: real slime moulds use multiple chemicals, intracellular flow, and rhythmic contractions. The simulator captures the essential positive-feedback mechanism that explains why simple foragers can find efficient paths.
Why does the diffusion step matter?
Without diffusion the trail would be a pixel-thin track that no other agent could see. Diffusion smears it sideways into a gradient that nearby agents can follow, which is what lets stigmergic networks form at all.