This demo is taken directly from StarLogo. I began playing with StarLogo when the Java version was released in the spring. It was obvious from the beginning that some of the capabilities of StarLogo (multiple turtles and parallel processing) could be duplicated in MicroWorlds. Below is my attempt to rewrite a few of the StarLogo demos in MicroWorlds.
The creators of StarLogo have rated it PG-13. They feel it is more appropriate for older kids. In duplicating some of the funtionality of StarLogo in MicroWorlds I believe a natural migration path can be created.
For a complete description of StarLogo see Turtles, Termites, and Traffic Jams by Mitchel Resnick the developer of StarLogo.
The two biggest drawbacks in implementing a subset of StarLogo are the missing primatives to control the turtles and the limitation on the number of turtles that can be active at one time.
The first limitation can be overcome in part by writing the needed routines in MicroWorlds. The first routine needed was a way to create multiple turtles. In StarLogo the turtles are hatched at position 0 0, given headings evenly spaced around the circle, hidden and given a unique color. For this demo hatch looks like this:
to hatch :num :prefix let [ci 5] dotimes [i :num] [newturtle word :prefix :i seth (360 / :num) * :i setc :ci + (:i * 10) if (remainder :i 14) = 0 [make "ci :ci + 1] ] endNum is the number of turtles being hatched. Prefix is added to the turtle number when hatched to give the turtles in this group a unique id. Ci is used to set the color of the turtles.
There are other concepts from StarLogo which could be implemented in MicroWorlds. The next area of interest is StarLogo's use of color patches to control the behavior of turtles. As MicroWorlds allows colors to control turtle behavior and for turtles to sense what color they are over a simplified patch could be implemented.
The demo and cdemo buttons run simple demonstrations of the multiple turtle capabilities of the project. Both demo's use the slider num to set the number of turtles hatched. Cdemo also uses the slider desired-di: (desired-distance) to set the length of the lines and diameter of the circles it draws. Keep it small or else it draws off the screen.
The second part of the demo is StarLogo's circle demo. It is probably best if you look at their page for a description of the project (This will open in a new browser window so that the project remains active.). If you wish to just run it now leave the sliders as they are set press setup, wait for the turtles to appear and then press both allRepel and allAdjust then sit back and wait. Be careful, there is something very hypnotic about watching the circle form.
The Project
Home |
This page created in part with
Arachnophilia