Antworld
From Ben Shirt-Ediss
AntWorld is an Artificial Life (a-life) simulation tool where colonies of small circular ant-like entities, controlled by simple reactive neural networks, are evolved to display desired behaviours in a virtual (computer generated) environment. The program features an in-built environment designer for a-life experiments, plus simulation aids such as a neural-network analysis tool, real-time graphing and functionality to store interesting ants, ant colonies or populations of colonies for re-use in future simulation sessions.Antworld was developed as part of my Undergraduate Dissertation Project (2003) at the University of Sheffield in the Department of Computer Science (supervised by Dr. Amanda Sharkey).
Contents |
Interesting emergent behaviours
When the simulation of a colony begins, a hoard of orange ants emanate from the nest site and whiz around the designed environment, interacting in interesting ways. Each individual has it's behaviour determined by a unique on-board Multi-Layered Perceptron network.
In the current implementation, the virtual ants have a local sense of wall bricks, food units, pheromone particles, each other and the nest site. In turn, they can pickup up or drop food units, drop pheromone of different concentrations, and move to an adjacent pixel. Some individuals follow the pheromone trails laid by others. Others spin wildly, but eventually produce irregular or spiraling trails around their nest mates. Still others explore and avoid walls with amazing competence. In fact, the diversity and complexity of reactive behaviour that results within a colony is quite remarkable, and quite fun to watch!
The idea behind Antworld
My Undergraduate Dissertation Project (2003) entitled "Exploring the emergence of foraging strategies in a simulated group of reactive ant-like agents" aimed to use the AntWorld tool to explore if a group of extremely simple individuals, whose perceptions were directly tied to their actions, could solve a foraging problem. Throughout, the work had a distinctly nouvelle AI flavour.
Inspiration came from simple and elegant solutions to complex problems existing in nature. Ant scouts of the species Leptothorax Albipennis, for example, can reliably estimate the quality of a potential new nest site by using a method similar to the Buffons Needle Algorithm for empirically estimating the mathematical constant pi. Through laying a random pheromone trail on one visit and then, at a later visit, measuring the intersection frequency of it's path with the previously laid trail, an ant scout could obtain a reliable estimate for the nest floor area. No 'higher' cognitive abilities were necessary for this seemingly "intelligent" act. Rather, the success of the method was based purely on the basic spatial relations between the laid pheromone trail and the size of the nest floor.
I wanted to extend ideas like these to see how applicable they were to a more complex problem of a colony foraging for food particles. Relying only on the local information they received, and exploiting the interactions between themselves and the environment they inhabited, reactive ant agents had to establish an effective colony dynamic allowing the search and transport of food particles from one side of the environment back to the nest site. None of the agent's had internal state or memory. Instead, it was hoped that (collective) colonial foraging behaviour would emerge through dense interactions between the simple reactive constituents. A Genetic Algorithm was used as a tool to mix up and evolve successful groups over a long time frame.
The relative success of the study would hopefully give insight into the minimal amount of neural hardware a worker ant could possess to effectively carry out it's duties.
Running Antworld
AntWorld runs on Mac, Windows and Linux - any system with a Java Runtime Environment (JRE) installed. Most modern operating systems ship with a JRE.
Download:
The original user guide I wrote is worth reading too, even if you are not a Windows user:
Running on Mac and Linux is simple. Extract the class files to a directory, change to that directory in the terminal and then type
$ java exeAntWorld 1
Some Interesting Ants to Try
The Neural Networks for some early, not particularly evolved but nevertheless interesting ants are available below. It is advisable to use these controllers in an environment with size 8 wall bricks. Unzip the .mlp file, click an ant in the program and then click the folder icon at the bottom of the window displaying the neural network to load the new network into the ant's brain.
Note: despite the complexity of behaviour they produce, all of these networks are just purely reactive, feed forward multi-layered perceptron neural networks.
- Avoider - Avoids walls and food.
- Robust Avoider - Avoids walls and food more robustly. The agent has no internal state, but by laying pheromone, it is able to create a simple kind of memory in the environment. When becoming stuck on a wall, after a time, the natural decay of the pheromone around the agent causes it to turn and thus un-stick itself.
- Food Scout - Travels the arena, avoiding walls until a food source is found. Patrols the food source for a while before leaving the patch in search of another one.
- Food Protector - Locates a food patch, and then indefinitely circles the perimeter of the food patch.
- Square Hover Spinner - An interesting character. Tightly spins on its axis and uses a small amount of decaying pheromone to produce a slow movement path with straight edges. Quite unpredictable and moves in sudden bursts.
- Spiral Scout - Moves around the environment in wide beautiful spirals (a very robust obstacle avoidance strategy). Lays heavy pheromone trail.
- Follower - Attracted toward and follows the other ants. Drops lots of pheromone and leverages pheromone decay like the 'Robust Avoider' above to give complex avoidance behaviour.
- Nestmate Circler - Circles nest mates congregated around the nest entrance.
- Strange Dancer - Moves by way of a strange sideways translation movement.
Historic versions
Antworld Version 1.0 was originally developed as part of my Undergraduate Dissertation Project (2003) at the University of Sheffield, England, in partial fulfillment of BSc Artificial Intelligence and Computer Science, submitted May 9th 2003. The project was subsequently awarded a First Class.
Antworld Version 2.0 was completed in the subsequent months after graduation, and featured an improved user interface.
