Ants communities simulation (II)

Experimenting with the basic model

The first variation that is the inclusion of forgetful ants. We will allow ants to remember the food location for a number of time steps. The next applet shows the the simulation in the case that ants can remember for 3 time steps (including the current time step).

You can reset the simulation, and before pressing Continue change the ants memory length (variable MEMOLEN). Variables can be changed by pressing the Globals button. You can also change the food position by changing arrays FOX and FOY of object T1 (pressing the T1 button).
For the food distances and the ants number chosen, three time steps seems to be the lower limit for the whole community to learn where the food is. For longer distances a longer memory is needed.
Another interesting situation arises when we model a reinforcement of knowledge. Each ant encounter, in which both individuals know the same food position, will result in a reinforcement of their knowledge (they will remember one time step more). In this situation, a memory of two steps (remembering the present time step and the next) is enough to spread the knowledge of a food position in a population of 200 ants.
Another situation that have been tested is:

In this situation, the knowledge curve grows more in the moments when a place with a greater amount of food is detected.
Other situations that can be modelled are:

Extending the basic model for distribution

For larger communities, it would be interesting to use a distributed approach. For the distributed model, we will extend the TERRITORY class, so as to be able to define eight surrounding territories. We impose periodic conditions (an ant leaving the upper territory appears in the lower one, the whole environment is a flat torus by the left or right). Territories will contain a collection with the ants living on ot. The ANT class remains almost the same, but we have to check if the ant is leaving its territory and keep trace of the territory where its anthill is.
For distribution, we will place each territory in a different machine. The behaviour of the ants belonging to the territory is executed locally. When an ant leaves its territory, it has to be moved to another machine, but this is transparent to the programmer, as the system performs a collection change.
When an ant is returning to its anthill, it has to check if it is located in its own territory. If not, it has to return to it. The resulting model is shown here.
Class TERRITORY has eight methods to configure the neighbourhood (SETLEFT, SETRIGHT, SETUPPER, etc). Each territory is supposed to be a square from (-150 to 150). Each TERRITORY object has a collection of ants. Initially, each collection is initialized with five hundred ants. Class TERRITORY also has a method that is invoked when an ant is entering the territory. This method adds the ant to the collection by means of the overloaded operator "+=". The ant class is extended to check if it is leaving the local machine. If this is the case, the object moves to the collection in the appropriate territory. If the model is distributed, this implies a machine change, but it is totally transparent to the programmer. Ants also check in which territory its anthill is when returning to it.
Nine territories are created , with an anthill each (lines 43-47), each one in a different machine (labels m1 to m9). This correspondence between labels and physical addresses is defined in file machines.csm. By using labels, we keep the model independent from the physical locations. If we change the machines running the simulation, we have to change the machines.csm file, but the main model remains untouched.
The main initial section (line 49) configures the territories. This section is executed only once, at the beginning of the simulation. The main simulation loop (lines 55 and 56) invokes the dynamic section of each TERRITORY object.
A single model is needed, but it has to be compiled nine times, once for each machine taking part in the simulation.

Conclusions and future work

This paper has presented several models that simulate the behaviour of large ants communities, in the single machine case, and in the distributed case. The resulting models are compact, and it is easy to migrate from single-machine models to distributed models. Distribution details and object machine location are transparent to the model programmer. Distribution models allow us to run simulations with a high number of individuals: we have tested the simulation with four thousand five hundred ants. The models are highly scalable and portable. Different situations have also been tested such as forgetful ants, finite food, etc.
At present, we are comparing and enriching our system with results obtained by means of other formalisms, such as cellular authomata and L-Systems, although they have some limitations, for instance it is difficult to represent individual memory. We also want to characterize the "knowledge curve" in terms of food amount, food distance, number of individuals, etc.
We think these experiments can serve as an analogy for the flow of knowlede among human beings. Some of the concepts that can be studied are:

With respect to the system, in the future we are planning to migrate from RMI to Corba as the supporting technology for distribution. This will allow us to mix Java code and C++ code in a single simulation (our compiler is able to produce code in both languages). We are also planning to extend the language with some formalism to achieve true agent based simulations, such as fuzzy logic.

References