StarLogo Project:

Circle



WHAT IS IT?

This project shows a new way to create a circle with Logo. 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", (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)?

STARLOGO FEATURES

If you kill turtles while certain "forever buttons" are running, the computer might crash (since the buttons might refer to turtles that no longer exist). So, in this project, the SETUP procedure explicitly stops the forever buttons before killing the turtles (with the CA command).