Page 1 of 1

AI Ants

Posted: Sat Mar 10, 2012 5:27 pm
by NJames
Artificial Intelligence Ant Colony

This version has ants that move simultaneously. If two or more ants attempt to move to same square, none will move.

The ants see only the themselves and the eight squares around them. Each ant has a behavior that may change and a memory that indicates the location of the colony.

Behaviors:
new ant - remember nest location, choose random direction to search
searching - pickup food if found and head for nest, otherwise keep searching
return to nest - take direct route to nest
panic - (if running out of food) return to nest but stop and get food from nearby ants

I avoid permanent traffic jams by making the ants move randomly every once in a while.

The cells that have been traveled are colored. No pheromones are used.

Re: AI Ants

Posted: Sat Mar 10, 2012 5:31 pm
by NJames
This version does not use simultaneous movement. Each ant is asked in turn, where he wants to go. This seems to cause MORE traffic jams!

These ants still only see the area around them, but they do not remember the nest location. Instead, they leave pheromone trails.

Click on the map to cycle view through "nest trail", "food trail" and "no trail"

Behaviors:
find unexplored area
get food
go to nest