Ants Simulation
This page by Tamir Heyman and Tzach Livyatan is part of the Seminar on
Multi-Robotics (CS 236805) Winter 1999/2000
Technion - Israel Institute of Technology, Department
of Computer Science
This simulation is inspire by Prof. Freddy Bruckstein paper:
"Why the ant trails look so straight and nice", The Mathematical Intelligencer, Vol. 15, No. 2, pp. 58-62, 1993.
Some of the difference between the original algorithm and our simulation is describe here.
A documentation of the code is available here.
The simulation has two modes:
Cyclic pursuit.
As the applet load you are in the Cyclic pursuit mode.
You can insert the initial ants positions by clicking the mouse on the white panel.
When you hit the "Run" key, every ant wills pursuit the next one. The ant order in
the Cyclic pursuit, is by the order they created (the last one pursuit the first).
Trail pursuit
Choose the option "Trail" in the first (left) multi-choice button.
Here you should insert a path for the first ant. Every click by the mouse will mark a point in the trail.
Click "Run" to start the simulation.
The first ant will follow the line you draw from start to end.
The next ant (created "Gap" time units after the previous one) will pursuit the previous one.
Help
This section explain the buttons in the applet from left to right:
Cyclic / Trail
let you choose the type of pursuit you wish to run.
When the simulation run, this option become disable.
Delay
Slow the simulation to some degree.
Gap
This option is relevant only in the Trail pursuit. The number is the time gap between two ants starting the trail.
Path / No path
Draw or not draw the path of every ant. You can change this option at every point in the simulation.
Step
Execute one simulation step.
Run
Run the simulation.
Clear
Clear all the data and let you enter new one.
Due to programming limitation we did not implement the exact pursuit algorithm as represented in Bruckstein paper, rather a similar one.
In the original paper the algorithm for every ant is very simple: advance in the direction of the next ant. For every ant there one constant 'next' ant it pursuit.
If one ant catch the next on the two ants start to walk together from this time and on.
In a simulation, one must use some deviation of time to units. In our program, every time unit every ant "jump" to a new location. This location is one distance unit forward the next ant. If an ant distance to its next is less the one unit, the ant jumps to the exact location of it.
According to the original algorithm, all the ants should move together. Here we must move the ants in some order (at every time unit). To simulate this we move every ant to the next ant previous location. By this it is not important in witch order the ants are actually move.
This change cause some different in the behavior of the ants. As long as the distance between two ants is substantially larger then one distance unit, the behavior is very similar. When the ants are closer to each other (say less the one unit) one ant close the gap between them in one "jump". This can hardly be seen at the simulation because the distance unit is one pixel.