• No results found

3.5 Ant Movement

3.5.3 Ant Encounters

where P(e) is the probability of selecting edge e, E is the total number of edges.

The residual parameter is therefore defined as a percentage of the total pheromone on the edges leading out of the node. A zero value neutralises this parameter and a high r value creates random choices. Thus it is possible to check how it is helping prevent local maxima or having no effect.

Implementation of the probabilistic selection is by assigning each edge an accumulating numeric range, which is calculated using the probability calculation in equation (3.5). If one edge has half the total pheromone on the edges and the other two each have a quarter, then the edges are assigned a number range of 1 to 50, 51 to 75, and 76 to 100 respectively. If the random number outputs 81, then the third edge is chosen by the ant.

3.5.3 Ant Encounters

A fundamental concept underlying the MPACA is the ants’ ability to acquire features from other ants, and append them in their carried feature list, effectively learning new feature combinations. For example, if ants searching for feature “blue”, keep encountering other ants carrying feature “large”, where such feature combinations have been encountered a number of times which ex- ceeds the feature merging threshold parameter, then these two distinct features are coupled. Colony merging represents another crucial operator. If ants co-occur within the same region of space, then this makes it ever more likely that such ants should belong to the same colony. This occurs since ants keep a record of other ants they have encountered and their respective colony Id. When the number of encounters with a specific colony Id exceeds the colony merge threshold parameter, the ant will set its colony identifier to this other colony Id. Therefore, an ant colony is a collection of distinct ants, which are collectively labelled with the same colony Id. Both feature and colony merging are executed asynchronously by the ants and independently of each other.

3.5.3.1 Identifying Ant Feature Encounters

Encounters with other ants are recorded for both feature and colony merging purposes. To help clarity of the explanation, the ant whose feature list will be updated is termed the focus ant. Its encounters with other ants are only monitored and recorded when it arrives at a node and only with ants within its visibility. This is controlled by the visibility parameter, which is the number of steps along an edge an ant can see.

Ants remain true to their nature of being distributed and decentralised, as there is no communica- tion between ants apart from when they analyse each other because they are within the visibility range. The focus ant is able to see what features other ants are carrying and it maintains a queue for recording them during encounters. This data addition is implemented at the ant level of the focus ant, hence no other ant is influenced by this change.

If the focus ant is in deposit mode, ants at the same node or departing the same node it is in which are also in deposit mode, have their features added to the encountered features queue. This is due to the fact that ants departing such a node and are still in deposit mode, are so as they found this node interesting to them. Likewise, ants which are travelling towards a node, irrespective of the deposition mode they are in, have their features added to the encountered features queue. This since, if ants are travelling towards a node, they must be heading towards this node in believing that the node is also of interest to them. If the focus ant is not in deposit mode, then only ants coming towards its current node which are in deposit mode have their features added to the encountered features queue. This is because they are showing interest in the node they have left and this is the node chosen by the focus ant due to the pheromones on the edge.

This mechanism is operationalised by algorithm (6). The result is that ants can detect nodes with combinations of features and that can merge with other ants into the same colony.

3.5.3.2 Data Structures for Recording Encounters

The MPACA uses collections of carried and detected features, that is the carried feature list, and the recorded ant feature encounters. The latter also includes a reference to the colony Id the seen ant was detected in. The carried feature list structure has the following properties:

• Feature Id, the feature identifier, common to all ants and created during the set-up and normalisation process;

• Value, the value within the feature itself, e.g. colour=blue or height=1.56; • Feature Dimension, the dimension value for the current feature; and

Algorithm 6 Updating Feature and Colony Encounters if (Ant is in deposit mode) then

Let α = Ants that are in deposit mode at or travelling away from the node for (ant ∈ α) do

Feature-encounters ← record encounter end for

Let β = Ants coming towards the node whether or not they are in deposit mode for (ant ∈ β ) do

Feature-encounters ← record encounter end for

else

Let γ = ants coming towards the focus ant which are in deposit mode for (ant ∈ γ) do

Feature-encounters ← record encounter end for

end if

• Time, the time instance when this feature has been acquired;

The mechanism which stores feature encounters is a first-in first-out queue, this allows the oldest encounters to be removed first. It consists of the following:

• Feature Id, which corresponds to a carried feature Id extracted from the encountered ant; • Ant Id, representing the ant Id of the encountered ant;

• Colony Id, a value pertaining to the ant it has been derived from;

• Deposit Mode, representing the deposition state the encountered ant was in at that specific time; and

• Time, a time-stamp value, that is the time instance when this feature is detected, taken from system time.

The operation of the MPACA requires that each ant is initialised as an entity with the following properties:

• Id, the unique identification of the ant within the entire system;

• Node At, the current node the ant is on. When traversing an edge this is set to null; • Traversing Edge, the current edge the ant is traversing. When none this is set to null; • Tabu List, a single element list that stores the node the ant has just visited;

• Deposit Mode, identifies the pheromone deposit state the ant is in (active/dormant); • Colony Id, the colony the ant is currently a member of;

• Carried Features List, a collection of features including the base/instinct feature and other acquired features; and

• Encountered Features Queue, a recorded instance of all the features the ant detects, being carried by other ants which are within its visibility radius.