Killer Ants

Well, they don't just kill each other; they also reproduce...

There are blue ants (males), red ants (females) and green ants (kids). When a blue ant and a red ant meet, a new green ant is created (because, well, you know...). Green ants cannot leave the rectangle in the middle until they become adult (blue or red). How long it takes for a green ant to become adult is specified by the maturity parameters (the numbers of steps a green ant needs to walk before it becomes blue or red).

When an adult ant (blue or red) meets another adult of the same gender, or meets a kid, they fight. The probability for this adult ant to kill its opponent is specified by the kill probability parameter. Fights happen sequentially: if ant A kills ant B, then ant B is dead and cannot kill ant A. Therefore, it is impossible to exterminate all ants from a gender: if at some point there is at least one blue ant and one red ant, there will always be at least one blue and and one red ant, and hope of regeneration for the colony. Except in the rare case where all the initial green ants turn out to have the same gender (in which case the colony is not viable), a colony is indestructible.

By playing with the maturity and the kill probability parameters, one can adjust the population of the colony to a fairly stable value (with the default settings, population stabilizes around 150-200 ants). When the kill probability increases, the population decreases, obviously. When the maturity parameter increases, the population also decreases (because there is an increased probability for kids of being killed before they grow up and start to reproduce). So, the maturity parameter can be used as a secondary parameter to adjust the population with a less dramatic effect than the kill probability.

With both sliders completely to the right, the population of the colony will become very small, eventually reduced to one blue ant and one red ant. Moving the sliders back to the left will make the population increase, although it may take a while to grow back after it has been reduced to two ants (they first need to meet each other). It is not advisable to set the kill probability to zero, because ants then will overcrowd the colony (fights being the only cause of death). The overall population can be brought up to several thousand ants this way, but the applet will start to use quite a bit a CPU (you've been warned...).

You can download the application (killerAnts.jar), which has more control parameters than the applet (try java -jar killerAnts.jar -help).


Michel Charpentier <>
Last modified: Thu May 10 17:12:25 EDT 2007