|
|||
Home Page Download Models Community Models Extensions User Manual:![]() Web version![]() Printable version FAQ Resources Contact Us |
NetLogo Models Library: | ||
|
Run Kaleidoscope in your browser uses NetLogo 4.0.2 requires Java 1.4.1+ (system requirements) Note: If you download the NetLogo application, every model in the Models Library (besides the Community Models) is included. If you have trouble running this model in your browser, you may wish to download the application instead. |
WHAT IS IT?
This model uses NetLogo turtles to repeatedly draw circles, turning periodically so that the display gives the impression of a kaleidoscope or pinwheel.
HOW TO USE IT
The NTURTLES slider really determines the number of "arms" or "petals" that the kaleidoscope will have. Begin by setting this slider to the desired value (10 is fine).
Next, set COLOR-SEP to some value. COLOR-SEP basically determines the range of colors that the turtles (and hence
the kaleidoscope) will take on. The higher the value, the smaller the range. (For a nice, three-colored kaleidoscope, set COLOR-SEP to 25.) This inverse relation between COLOR-SEP and the color range is due to the fact that COLOR-SEP acts as a constant to divide a turtle's color by.
When you have set both NTURTLES and COLOR-SEP, press the SETUP button to set your kaleidoscope in motion.
Next, choose which pattern you want. Each pattern has its own forever-button that controls it. PATTERN-1 has the arms of the kaleidoscope all spiraling clockwise, while PATTERN-2 has the arms of the kaleidoscope spiral in both clockwise and counterclockwise directions, giving a slightly more complicated design.
Finally, you have the power to change the color distribution exhibited by this model. The COLOR-SHIFT button will either increment or decrement the value of COLOR-SEP used by the turtles -- saved internally as CURR-COLOR-SEP. (Thus the slider value itself isn't changed, but the number the turtles look at is.) This number is changed by a small random amount. The INCREASE-C? switch determines if CURR-COLOR-SEP is increased (true) or decreased (false).
You also have two monitors at the bottom of the Interface Window. COUNT-TURTLES will simply display the current number of turtles. Likewise, CURR-COLOR-SEP will display that variable's value, so that you know when it has been altered, and by how much.
THINGS TO NOTICE
First, just try playing around and observe what happens. This is meant to be a visually pleasing model just to watch. See what different values of NTURTLES and COLOR-SEP produce, and explore how COLOR-SHIFT changes the appearance of the kaleidoscope. What seems the best to you?
An important thing to notice here is the number given in COUNT-TURTLES. Right away, it becomes much larger than NTURTLES, but quickly settles on some nice big number. Take a look at the Procedures Window. There are really two levels of turtle commands going on here. Initially, upon setup, there are NTURTLES number of turtles. Once one of the pattern buttons is pressed, each of these turtles (who compose the "arms" of the kaleidoscope) repeatedly hatches a new turtle and turns by a single degree. The newly-hatched turtles begin to draw circles, self-destructing upon completion. As the "arm" turtles execute their commands much quicker than the hatched turtles, they produce many turtles during one loop of a circle; eventually, though, turtles start to die off. At this point, the number of turtles who are born is roughly equal to the number who die at any given step.
You also should notice how COLOR-SEP (or really CURR-COLOR-SEP) alters the appearance of the kaleidoscope. Turn COLOR-SHIFT on, and let CURR-COLOR-SEP become very large. Then watch what happens when it is small, maybe zero or some negative number.
THINGS TO TRY
Try changing the code in the Procedures Tab. Increase the size of the circles drawn by each of the turtles, or try changing the size of the angle each of the turtles turns through.
Instead of each turtle moving or turning a given amount, what about having it move a small random amount (as in the changes to curr-color-sep from COLOR-SHIFT). How much randomness can you add and still maintain some kind of overall structure?
EXTENDING THE MODEL
Whenever a turtle is hatched by one of the "arm" turtles, it proceeds to draw a circle. Change the HATCH command list so that it draws some other shape or pattern. Try to predict what overall shape will emerge.
Currently, the only difference between the two patterns is that PATTERN-2 has half of the "arm" turtles circle to the left, the other half to the right. Write your own pattern -- i.e., come up with a new command or set of commands for these turtles to execute.
Try to write an entirely new kind of model along similar lines. In the current model, turtles spin off from a center core of NTURTLES turtles. In your new model, maybe the drawing turtles could orbit around some fixed (or moving) point, like in the StarLogoT models N Bodies and Gravitation.
NETLOGO FEATURES
This makes nice use of the turtle primitive HATCH. Whenever a turtle is hatched, it executes the command list that follows the HATCH command. In most context this is used just to change the new turtle's color or alter some variable. But there's no reason it can't run some other, possibly lengthy, procedure, and that's exactly what happens here.
CREDITS AND REFERENCES
To refer to this model in academic publications, please use: Wilensky, U. (1998). NetLogo Kaleidoscope model. http://ccl.northwestern.edu/netlogo/models/Kaleidoscope. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
In other publications, please use: Copyright 1998 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/Kaleidoscope for terms of use.
(back to the NetLogo Models Library)