Home Download Help Resources Extensions FAQ References Contact Us Donate Models: Library Community Modeling Commons User Manuals: Web Printable Chinese Czech Japanese Spanish

NetLogo Models Library: 
If you download the NetLogo application, this model is included. (You can also run this model in your browser, but we don't recommend it; details here.) 
This program draws special types of pictures called fractals. A fractal is a shape that is selfsimilar  that is, it looks the same no matter how closely you zoom in or out For instance, a tree can be thought of as a fractal since if you look at the tree as a whole, you see a stick, that is to say the trunk, with branches coming out of it. Then if you look at a smaller portion of it, say a branch, you see a similar thing, namely, a stick with branches coming out of it.
This model allows you to draw and look at one class of fractals, called Lsystem fractals. LSystem fractals are made by following a set of rules over and over. The rules can be few, but a fascinating and complicated fractal can still form. By using different sets of rules, you can create a wide variety of different fractal designs.
In the beginning, there will be only one turtle for any fractal. Rules tell the turtle what to do. This turtle can do things such as draw a line, or turn to the right or left. This turtle can also split itself into two turtles. Each new turtle follows the same rules as the original turtle, and draws its own "branch" of the emerging fractal design.
Perhaps the best way to start with this program is by looking at examples of some Lsystem fractals. In the "Interface" tab, you will find a series of buttons: "Swirl", "Ball", etc. Each button sets up a different fractal. Some of these examples are famous fractals, such as Sierpinski's tree and Koch's snowflake. To view these examples, simply click on one of the example buttons and then press the GO ONCE button repeatedly.
You can also press GO and leave it pressed instead of pressing GO ONCE repeatedly. Watch the number of turtles though (in the COUNT TURTLES monitor). If it becomes very large the model may become very slow.
If you don't like the location of the fractal in the world you can change it by modifying the value of the following sliders:  INITX sets the initial x coordinate of the first turtle. It changes the horizontal starting location of the original turtle.  INITY sets the initial y coordinate of the first turtle. It changes the vertical starting location of the original turtle.
If you don't like the color scheme of the fractal you can change it by modifying the value of the following sliders:  INITCOLOR controls the initial color of the first turtle.  The value of COLORINC is added to the turtles color anytime a new turtle hatches.
The example buttons and the SETUP button choose the rules for a fractal. Each of the example buttons sets up the world to draw the fractal of the same name. The SETUP button sets up the world for drawing the rules found in the applyRules procedure in the Code tab.
Notice the selfsimilarity of the fractals at each iteration. What if one were to perform an infinite number of iterations? Would looking at any piece up close look any different than looking at the whole? Also notice how the number of turtles in each of the example is multiplied by some number at each iteration. Does this make sense? Try to figure out the number of turtles at some arbitrary step n for one or more of the examples.
Now that you have played around with settings for the examples provided, why not try making your own fractals. You can do this by changing the commands in the applyrules
procedure in the Code tab. The comments in that procedure list the commands you can use.
Try adding switches such as incrementbyrandomlength or decrementbyrandomdegree that could impose a random factor to the movement of the turtles. Then add to the forward and turning functions, for example, a random value to the number of steps and degrees. This would increase the realism in a fractal.
Pick up a book on fractals or search on the internet to find fractals that are interesting and try to create them using the rules of Lsystem fractals. You may find some resources below.
Try extending the set of rules so that there are more than the basic ones included in this model. Then use these rules to make new fractals.
Try starting with more than just one turtle, in a different location or heading, and see how that can affect the fractals that you have made. Does it ruin them or does it make them more interesting and complex?
The hatch
command is used to make an exact duplicate of an existing turtle.
The run
command is used to run the current rule set.
all of the other models in the Fractals section of the Models Library (under Mathematics)
You may find more information on LSystem fractals in the following locations:
This site offers some explanation and quite a few classic examples of Lsystems. http://www.kevs3d.co.uk/dev/lsystems/#
This site offers an introduction to fractals, including Lsystem fractals as well as others: http://web.cs.wpi.edu/~matt/courses/cs563/talks/cbyrd/pres1.html
The Fractal Geometry of Nature by Benoit Mandelbrot
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself:
Please cite the NetLogo software as:
Copyright 2001 Uri Wilensky.
This work is licensed under the Creative Commons AttributionNonCommercialShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/byncsa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.
This model was created as part of the projects: PARTICIPATORY SIMULATIONS: NETWORKBASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs)  grant numbers REC #9814682 and REC0126227.
(back to the NetLogo Models Library)