Talking_Ants_Application

chrfrantz edited this page May 16, 2016 · 2 revisions

The Talking Ants Application is an ant simulation implementation which integrates multiple threading mechanisms to measure fairness and performance. In contrast to the purely stygmergy-based interaction between ants, ants in this application can also interact via messages.

The application consists of a two-dimensional grid with an ant nest, randomly distributed food sources and a number of ants. Upon start ants forage for food ('foraging mode'). Once found, they release pheromone and carry their food back to the ant nest ('homing mode'). Once in the nest, they drop the food and continue to forage for food. For routing ants rely on the pheromone surrounding them. In addition, this implementation allows ants to exchange coordinate information if they the meet and are in opposite 'mode' (i.e. foraging vs. homing mode). If successful ants then directly move towards this coordinate without consideration of pheromone during routing. Upon goal fulfillment or exceeding a defined number of steps (e.g. 40 steps), ants fall back to the conventional pheromone-based interaction.

For further conceptual description and implementation purpose (as a fairness benchmark) please refer here, in particular here, Appendix B.

The figure below shows a screenshot of the application. The square in the upper left area represents the ant nest. Ants are black lines. If carrying food they are represented in red. If they follow an exchanged coordinate they are shown as blue squares. Pheromone is indicated by green colour. Food is indicated as red squares.

Simulation Software

Please find the full implementation for the Talking Ants Application here. For other µ² applications refer to the Application section on the Main Page.

Necessary software to run it:

Setup instructions for µ² are provided under Getting started.

Application Setup and Use

Setup

  1. Install µ² in Eclipse (using the setup instructions mentioned above).

  2. Copy the 'cljScripts' folder contained in the application archive into the Eclipse project.

  3. Copy the 'microapps' folder contained in the application archive into the 'src' folder of the Eclipse project.

  4. Run the Talking Ants Application by using Main.java. Parameterization (Threading mechanism, Number of ants, benchmark duration, ...) is done in this file.

Use

Parameterize the application within the Main.java file and run it (Right-click, select "Run As" --> "Java Application").

Clojure REPL commands available for interactive control at runtime (in the console window of Eclipse) include

  • (start) -- starts application execution
  • (stop) -- stops application execution
  • (pause) -- pauses application execution
  • (resume) -- resumes application execution
  • (stats) -- prints stats (e.g. duration, number of ant interactions, number of collected foods, ...)
  • (stop-talking) -- disables the direct exchange of coordinates (talking) of ants
  • (start-talking) -- enables the direct exchange of coordinates (talking) of ants
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.