SimulatorEducationEntertainmentDeveloper

Physarum Slime Mold Simulator

Thousands of single-cell agents lay pheromone trails, follow each other's strongest scent, and self-organise into living networks. The same algorithm a real Physarum slime mould used to rediscover the Tokyo subway map.

Sensor angle35°
Rotate angle35°
Sensor distance9px
Step length1.0px
Pheromone decay93.0%
Deposit5
Agent count8,000

Palette

What is happening on the canvas

Every white-ish trail is the cumulative path of thousands of tiny agents. Each agent follows three steps every frame:

  1. Sense the pheromone field at three sensor points — front, front-left, front-right.
  2. Turn toward whichever sensor reads strongest.
  3. Move forward one step and deposit a little pheromone where it lands.

In parallel, the pheromone field diffuses to neighbouring cells and decays a few percent per frame. There is no central planner — but the agents constantly reinforce the trails that other agents have already taken, and the system condenses into networks of veins, loops, and hubs.

The parameter zoo

ParameterEffect
Sensor angleWider angle finds trails further off-axis — fuzzier branches.
Rotate angleHow sharply agents turn each step. Equal to sensor angle gives stable lines.
Sensor distanceHow far ahead they look. Short = thin, dense webs; long = sweeping curves.
DecayHigh decay → fragile, fast-changing networks; low decay → persistent veins.
Agent countDensity of the resulting network — more agents form thicker bundles.

The classic Jeff Jones (2010) settings live around sensor angle 22°, distance 9 px, rotate 45°, decay ~5%. Push values around and you can reproduce neuron-like nets, blood-vessel patterns, or featureless noise.

A real slime mould that solves maps

Physarum polycephalum is a real organism with no nervous system, just one giant cell with many nuclei. In 2010 researchers placed oat flakes at the positions of Tokyo's major cities on a wet plate. The slime mould grew between them and pruned its tubes — within hours, it reproduced a network strikingly similar to the actual Tokyo subway map, just from local rules.

The algorithm in this simulator is a digital model of that behaviour. The same patterns turn up in fungal mycelia, river deltas, and the cytoskeleton — anywhere transport networks have to be built without a blueprint.

Things to try

  • Crank deposit + lower decay for thick, glowing veins that look biological.
  • Big sensor distance, small rotate creates long, smooth curves like ocean currents.
  • Sensor angle ≠ rotate angle destabilises the agents and the network constantly shifts.
  • Drop agents to 1,000 to see individual paths; push to 30,000 for dense plasma.