Circle

What is it?

This project shows a new way to create a circle with StarLogo. The turtles don't draw a circle. Rather, the turtles arrange themselves into a circle, based on their interactions with one another.

Each turtle follows two simple rules: (1) it tries to keep a certain distance from each of its two "neighbors", and (2) it gently "repels" the group as a whole, trying to move away from the other turtles. With these two rules, the turtles arrange themselves into a circle.

How to Use It

Click the `setup` button to set up the turtles. Click the `adjust` button, then click the `repel` button.

The `num` slider controls the total number of turtles.
The `desired-distance` slider controls the distance that each turtle tries to keep from its neighbors.
The `convergence` slider controls how quickly the turtles move toward the desired distance from their neighbors.
The `repel-strength` slider controls how strongly each turtle tries to move away from the group as a whole.

Things to Notice

When you click on the `adjust` button, the turtles "relax" into a pattern with each turtle at the desired distance from its two neighbors. There are many ways for each turtle to be equidistant from its two neighbors. When you turn on the `repel` button, the turtles move to a different "solution": a circle.

After the turtles have formed a circle, reduce the `desired-distance` slider and the circle shrinks. Increase the `desired-distance` and the circle expands.

Explorations
Change the `setup` procedure so that the turtles start in random positions all over the screen (not clustered near the middle, as in the original `setup` procedure). Then turn on the `adjust` and `repel` sliders. Do the turtles still form a circle? What happens if you turn on only the `repel` button (and not the `adjust` button) What happens if you perturb the circle?

###

We welcome your feedback and suggestions! Please send us email.