Ants 1

Emergent Ant Colony Behavior — simulated.

Murtaza Tunio
BurningDaylight
4 min readDec 18, 2017

--

Pheromone trail left by ants moving from the colony (top) to a food source.

See: The principles of collective animal behaviour — D.J.T Sumpter

Sumpter:

The canonical example of a self-organized animal behaviour is ant pheromone trails. Many species of ants deposit chemicals, known as pheromones, to mark the route from food to nest (Wilson 1971). After finding a food source and feeding, an ant returns to the nest, pausing at regular intervals on its way to leave small amounts of pheromone. […] Other ants, which were previously unaware of the food source and encounter the trail, will follow the trail and find the food source. Once they have collected food, these follower ants also leave pheromone on their return journey. Through this positive reinforcement, the pheromone trail builds up and after a short time we see a steady trail of ants walking between food and nest. Pheromone trails are formed purely on the basis of local information.

Despite their simplicity, pheromone trails can be used to solve the problem of directing the majority of ants on the shortest route from food to nest. […]

I wrote a short script to simulate the basic aspects of ant path-finding behavior. Surprisingly, I had to work hard to dial in the correct rule-sets for each ant. Even so, there are some issues I have yet to resolve with the simulation. It is particularly hard to specify a ‘find food’ and ‘return home’ state without significantly biasing the direction the ant must travel in . Also, I am still experimenting with the right boundary conditions for each terrain — should the ants die at each boundary? Should they change states to go home? Should they wrap around to the opposing boundary? etc. For now I have set each ant to re-spawn in the ant-hill if it hits a boundary. I am studying the problems and will hopefully resolve them in the coming revisions, hopefully with a more succinct set of assumptions. Until then, here are a few preliminary results.

The simulation has two basic components, the environment and the ant. The environment contains the location of the ant-hill, yellow square in the top-center of the grid, and the location of food sources, all of the other yellow squares. The ant class moves randomly, and is biased to follow the path of any pheromone trails it encounters. Ants spawn at regular intervals from the colony. Moreover, the ants leave a trail of pheromones as they move around. The pheromone trails evaporate at a constant rate. In the simulations below the ant-hill, food sources, and evolving pheromone trails are highlighted in yellow.

The key aspects to note is that each ant is given only local awareness, and as a colony the ants still manage to route efficiently from the closest food source to the ant hill.

The most basic case, with the ant-hill at the top and food source at the bottom of the terrain:

Ant-hill at the top, food source at the bottom

Another case, with two food sources equidistant from the ant-hill. The ants initially feed from from both food sources until spontaneously choosing one (perhaps because that side had a slightly stronger pheromone trail:

Equidistant food sources

Two cases where one food source is slightly farther away from the colony than the other. The ants invariably choose the food source that is closer to the colony:

Left: Food source on the left side is farther, Right: Food source on the right side is farther
Case where food source on left is farther
Case where food source on the right is farther

This is a work in progress, any comments and critique are welcomed. You can follow the project on:

--

--