User Tools

Site Tools


ant_lab_1

This is an old revision of the document!


Ant Lab 1

Ants are wonderfully simple things that can behave in complex ways (kind of like a computer)! So why not see if we can program a simulation of some ants randomly walking around. As long as they don't know where food is they will keep walking, and after short while will randomly change their direction.

Next we need to give them some knowledge. When they detect food, they will record the location of the food, and just go back and forth from their AntHill to the the Food supply. When the Food runs out, they will forget the location, and go back into random walking, like before.

Finally, we will want to give them some communication skills. If they encounter another Ant, they will share any information about food. Maybe later you can make a subclass of Ant called GeniusAnt that will remember more than one food source, but for right now, it an ''Ant can only remember one thing at a time. You can always enhance your simulation by adding obstacles or ants from another colony that will fight with.

ant_lab_1.1542994878.txt.gz · Last modified: 2018/11/23 12:41 by cthiel

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki