NetLogo banner

 Home
 Download
 Help
 Resources
 Extensions
 FAQ
 References
 Contact Us
 Donate

 Models:
 Library
 Community
 Modeling Commons

 User Manuals:
 Web
 Printable
 Chinese
 Czech
 Japanese

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

AntsOpt

by Erich Neuwirth (Submitted: 6/25/2002 )

[screen shot]

Download AntsOpt
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

(You can also run this model in your browser, but we don't recommend it; details here.)

In this model ants try to find a short path from the
left upper corner to the right lower corner of the area.

There are pools and lakes (blue) which the ants cannot enter.
And there is normal soil (brown) and wood (green).
Ants are only half as fast in wood than on normal soil.

The ants "communicate" by dropping pheromone on the ground.
The purpose of the pheromone is to indicate "preferable directions"
to go on.
When an ant decides which directions to go
it does so randomly, with probabilities proportional
to the pheromone values for the different directions.

In the beginning, on any spot all legal directions have the same
pheromone value.
So the first ant takes a completely random path.
When an ant arrives, it traces its path back and drops pheromone
on all the spots, in the directions it has taken.
It drops only a little pheromone if the path was long, and it drops
more pheromone if the path was short. So pheromone "piles up"
on spots belonging to a short path.

Turtles starting later already get hints on which directions
to take, and so the paths becomes shorter and shorter for some time.

The setup button creates a new map of an area.
Not all maps work. If the start or the goal is completely blocked
by water, start and goal cannot be connected.

The clear button resets the pheromone values to the initial state.
The remove-loops switch allows you to play with "smart ants".
When the switch is on, the ants remove all the loops the have
walked before retracing there paths backward.

The run button starts a number of ants (one after the other),
and the slider next to it controls the number of ants to be started.

The delay slider allows you to stop the ants for some time before they start
retracing so you can see the pattern of the paths better.
The ant path is turqoise on the way to the goal, and yellow when the ant
goes back dropping the pheromone.

The monitors should be self explaining.

The histogram at the bottom displays the lengths of all paths so far.
You can change the width with the slider, and after a change you can replot
with the button.

(back to the NetLogo User Community Models)