This page was automatically generated by NetLogo 5.0.
The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Sun's Java site.
powered by NetLogo
view/download model file: dla.nlogo
This is a simulation of diffusion limited aggregation (DLA), based on the description provided by Mullins (2011). According to Mullins, “DLA is a process first discussed in Witten and Meakin (1983), where particles moving about randomly aggregate to form Brownian trees, a type of fractal structure found in nature (e.g. crystal growth, dust coalescence and snow flakes). To clarify the meaning of DLA, diffusion refers to the movement of particles due to temperature fluctuations, limited refers to the increase in size by one particle at a time, and aggregation refers to the collection of particles connected together.”
A stationary particle is placed at the center of the graphics pane. This is the start of the DLA structure. You can use a button to introduce more particles. These particles perform a random walk. If a particle gets within a used-specified distance of a particle in the DLA structure it stops moving and is now a part of the DLA structure.
If a particle moves outside the graphics pane boundaries it is moved to a random location within the graphics pane (more precisely it is killed and a new particle is created).
Click SETUP to initialize the center particle. This particle is white to denote that it is part of the DLA structure.
Click MOVE to have the simulation start. Note that nothing will happen until the ADD 100 button is clicked.
When ADD 100 is clicked 100 particles are randomly placed in the graphics pane. These particles are yellow until they become part of the DLA structure, at which point they become white. The initial heading of each particle is towards the center of the graphics pane.
Every time step each particle that is not part of the DLA structure performs a parameterized random walk. The parameter is controlled with the WIGGLE_AMOUNT slider. Particles uniformly turn left or right from -WIGGLE_AMOUNT to WIGGLE_AMOUNT degrees. Hence, if WIGGLE_AMOUNT is set to zero, the particles move straight to the center. If WIGGLE_AMOUNT is set to 180, then this is a random walk.
When a particle gets within DESIRED_SEPARATION of a particle in the DLA structure it stops moving and is incorporated into the structure. If there is no particle within distance DESIRED_SEPARATION, the random walk is performed. Similarly, if too many particles are within DESIRED_SEPARATION distance the random walk is performed. The BETA slider controls the number of particles that are considered to be too many.
All the sliders will affect the simulation while yellow particles remain.
If a particle moves to the edge of the graphics pane it dies, but is immediately replaced by a new particle that is randomly placed within the graphics pane. Hence the number of particles remains constant.
Usually it is reasonable to press “ADD 100” numerous times to get a sufficient number of particles into the simulation. Roughly 1000 is reasonable.
If the DESIRED_SEPARATION is large enough you will see green lines between pairs of white particles in the DLA structure. This helps to better show the precise structure of the DLA.
See how WIGGLE_AMOUNT changes behavior. Similarly, change DESIRED_SEPARATION and BETA.
Note, in order to change any NetLogo simulation, you must have the source code (i.e., “dla.nlogo”) downloaded to your computer, as well as NetLogo itself. You can not change the code when you are running the simulation with your browser.
This simulation makes good use of the “hatch” command, both to re-introduce particles that stray out of the graphics pane, and to draw the green lines between pairs of white particles in the DLA structure.
This code is based on the description of DLA provided by “Autonomous Recharging of Swarm Robots” by Jonathan Mullins, Bachelor of Software Engineering thesis from Clayton School of Information Technology Monash University, June, 2011
Witten, T. A. and Meakin, P. (1983). Diffusion-limited aggregation at multiple growth
sites, Phys. Rev. B 28(10): 5632-5642.
If you mention this model in an academic publication, we ask that you include these citations for the model itself and for the NetLogo software:
- Spears, William M. (2012) Diffusion Limited Aggregation Algorithm in NetLogo.
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
Copyright 2012 William M. Spears. All rights reserved.
Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:
a) this copyright notice is included, and
b) this model will not be redistributed for profit without permission from William M. Spears. Contact William M. Spears for appropriate licenses for redistribution for profit.
; William M. Spears May 2012 ; As per the robot algorithm described on pages 9, 10 and 31 of ; "Autonomous Recharging of Swarm Robots" by Jonathan Mullins, ; Bachelor of Software Engineering thesis from Clayton School ; of Information Technology Monash University, June, 2011 ; A crude implementation of Diffusion Limited Aggregation ; For research and educational use only breed [robots robot] ; Introduce the "robot" breed robots-own [done] to setup clear-all ; Clear everything create-robots 1 [setxy 0 0 set done true ; Create and initialize center robot set shape "circle" set color white set size 5] reset-ticks end to run-and-monitor if (count robots < 1) [user-message "Please click HALT and then SETUP AGENTS first" stop] ask robots [move-robots] tick end to move-robots if (not done) [ ; If not part of structure let friends other robots in-radius Desired_Separation with [color = white] ; If no friends nearby, or too many friends, random walk. ifelse ((count friends < 1) or (count friends > Beta)) [ ; Parameterized Random walk set heading heading + (random (2 * Wiggle_Amount) - Wiggle_Amount) fd 1 ; If boundary is hit, remove particle from world but create a new one also ifelse ((round xcor) = max-pxcor) [create 1 die] [ifelse ((round xcor) = (0 - max-pxcor)) [create 1 die] [ifelse ((round ycor) = max-pycor) [create 1 die] [if ((round ycor) = (0 - max-pycor)) [create 1 die]]]] ] [ let friend one-of friends ; If friends nearby let deltax (([xcor] of friend) - xcor) let deltay (([ycor] of friend) - ycor) let r sqrt (deltax * deltax + deltay * deltay) ; Create a "virtual" robot with a green pen down to draw the line hatch 1 [pd set color green set heading (atan deltax deltay) fd r die] set done true set color white ; Now part of the DLA structure ] ] end ; Create n new robots to create [n] ask one-of robots [hatch n [ setxy (15 * random-xcor / 16) (15 * random-ycor / 16) set heading (atan (0 - xcor) (0 - ycor)) set color yellow set done false ]] end