Growing a Crystal in AgentCubes

AgentCubes · Random walkers that stick

TipToday’s question

Scatter particles around a world, put one stuck particle in the middle, and let every other particle wander at random. Whenever a wandering particle touches the stuck cluster, it sticks too. What shape does the cluster grow into? Sketch your guess before we run it. A round blob? A square? Something else?

NoteSoftware

Open AgentCubes Online at agentsheets.com and sign in with the class account. This builds on Meet AgentCubes, where people wandered with move-random-on, and on the random walk from Module 9.5.

The model

There’s only one kind of agent that matters: a particle with two shapes.

  • moving (white): a particle that’s still wandering.
  • stopped (green): a particle that has joined the cluster and will never move again.

To start, paint the world with a background agent, scatter many moving particles across it, and place one stopped particle in the center as the seed.

The particle’s rules

AgentCubes rules for the particle agent. Rule 1: if see moving and next-to stopped greater than 0, then change to stopped. Rule 2: else if see moving, then move-random-on background.

Read each rule as a sentence:

  1. If I’m moving and at least one stopped particle is next to me, then I stop.
  2. Otherwise, if I’m moving, then I take one random step onto the background.

A stopped particle matches neither rule, so it does nothing. That’s the whole model: a random walk, plus “stick when you touch the cluster.”

Compare this with Meet AgentCubes. The rules have almost the same shape: “next to a sick person, become sick” is now “next to a stopped particle, stop.” The only difference is that a sick person kept moving, and a stopped particle doesn’t.

The controller

AgentCubes controller rule: plot-to-window agents_with_shape moving in window particles, in green, and agents_with_shape stopped in window particles, in red.

A separate controller agent counts the particles of each shape every tick and plots the counts. On the plot, green means moving and red means stopped, which is the opposite of the colors in the world, so read the legend.

What happens

A dark square world with scattered white dots and a green cluster in the middle with thin, branching arms reaching outward.

The world after a long run: a branching green cluster grows from the center, surrounded by white particles still wandering.

A line plot with a green line for moving particles falling steadily from 1,010 and a red line for stopped particles rising from 0.

The plot from the same run: moving particles (green) fall steadily from 1,010 as stopped particles (red) rise.

The cluster isn’t a blob. It grows thin, branching arms, like frost on a window or a snowflake. How did your sketch compare?

Why branches?

A particle wandering in from far away is much more likely to bump into the tip of an arm, which sticks out toward it, than to wander deep into a gap between two arms without touching either side first. So the tips keep catching particles and growing, and the gaps stay empty. Small bumps get bigger, and the cluster branches.

Nobody wrote “make branches” anywhere in the rules. Like the fire’s tipping point and the outbreak in a crowd, the shape emerges from simple local rules.

This model is called diffusion-limited aggregation. Scientists use it to describe real patterns that grow this way, including mineral deposits, frost, lightning-like electrical discharge, and some bacterial colonies.

Reading the plot

  • Why does the number of stopped particles climb slowly at first?
  • Is the red line straight, or does it bend as the cluster gets bigger? What would make the cluster grow faster later on?
  • Will every particle eventually stop? What would have to happen for the green line to reach 0?

Try it

Change one thing at a time and run it again:

  • Fewer particles. Start with half as many moving particles. Does the cluster grow as quickly? Does it look different?
  • Less sticky. Add percent-chance 25 to the first rule, so a particle sticks only some of the time when it touches the cluster. Do the arms get thicker or thinner? Why?
  • A different seed. Instead of one stopped particle in the center, paint a whole row of stopped particles along the bottom edge. What grows from a line?
ImportantWhat we practiced
  • A random walk plus one sticking rule is enough to build a complex shape.
  • An agent that matches no rule does nothing that tick.
  • A controller agent can watch the whole world and plot counts with agents_with_shape().
  • Complex patterns can emerge from simple local rules, here because tips catch more particles than gaps do.
Back to top