CSCS 530 – Agent Based Modeling – Winter 2009 Project 1 – Ants (Termites) and Food
February 20, 2009
Authors: Bala Deshpande, Justin Fogle
1.how to get a copy, compile, run:
cp –r /users/bdeshpan/CSCS530-Java/Project1_Deshpande_Fogle .
2.Overview of Conceptual design: Agents, what they do, what they sense, etc. Description of any measures.
This project is a simple model of ants (termites) in a 2D world. Bugs are randomly placed on a grid at start. A “nest” is defined at the center of the 2D grid. Three piles of "food" are placed at a locations varying in distance from nest. The closest pile is due East of the nest, followed by a pile due South and finally a pile farthest from the nest due NW. Each food pile has 25 pieces of food or “Foodchips”.
When the counter starts, the nest gives out pheromones which diffuse uniformly across the grid for a period of 100 ticks. This is done to “ground” the bugs to their home base. Bugs start to move randomly - if they run into a food item, they pick it up.
If a bug has picked up food, it will start heading in the direction of increasing pheromones. The nest pheromone level keeps increasing as more and more bugs deposit both food and pheromone at this location. Once a foodchip is deposited at the nest, it is removed from the world.
Bugs exploit the food resources in the order of proximity to the nest. There are several parameters which affect the behavior of the bugs. In the termite domain, these parameters are the number of bugs, nest location, the amount of pheromone dropped by each bug. In the environment domain, these parameters are the rate of exogenous pheromone addition, diffusion and evaporation of pheromone. All of these can be controlled at run time.
Using default values for the above parameters will result in all food being transported to the nest in approximately 1000 time steps.
3.Brief notes about implementation of conceptual design. Which objects represent what conceptual parts? Which parameters can be set, to do what?
Each ant is a Termite class which has an ID, x and y location, age (not used) and weight (not used). When an ant is carrying a piece of food, the food gets added as another variable (feature?) of the ant till it is put down. The ants randomly move about till they pick up food. Once they are carrying food, they get “smarter” and start looking for the home trail which is essentially an increasing pheromone gradient. Once the food is put down – this happens when the ant is in the neighborhood of the nest – it is removed from the world and from the ant. Nest is also an object (class Nest) which has x, y locations as its main variables.
''The main settable parameters are the following: 1.DiffusionK – constant of pheromone diffusion across the grid 2.EvapRate – rate of ph. Evaporation. Higher the number, lower the evaporation 3.ExogRate – rate at which pheromone is added into the world 4.PhFracAddedbytermite – a multiplier (or fraction) of the maximum pheromone level that can be added by each ant 5.NumTermites – Ant population 6.NestLocationx and y – typically center of the 2D world 7.Grid SizeX and SizeY – size of the 2D world''
'''4.Brief description of development history: Main observations in the development history are the following'''
Adding food: food location is controlled by the top left corner of the food pile – the x,y coordinates of this foodchip determines the overall position of the pile. We tried to limit the pile to a square of 25 pieces for aesthetics. Letting the location of food chip x and y control the shape of the food pile resulted in long strings of food (as opposed to a nice heap!)
Nest: Without a nest which gives out an initial “grounding” pheromone we found that each food pile would result in ants carrying and clustering around the pile. The ants had nowhere to go! We thus decided to add an initial pheromone at the nest and also to give some time (100 time steps) for this to diffuse uniformly. This is not so unreasonable because in the real world one would find a stronger pheromone trail near the nest (since ants originate from the nest in reality).
5.Summary of final version
The two main measures we collect are the amount of pheromone (averaged across the 2D grid) and food inventory.
We conducted some simple studies on how long it would take ants to collect all the food as a function of ant population and pheromone parameters.
Keeping pheromone parameters fixed at default: We found that as ant population increased, the collection time dropped up to a population of 250 and increased thereafter. Adding more ants after 250 (in a space of 2500 cells = 10% occupation) results in ants getting in each others way and slowing down the collecting process. Also with population less than 100 means there is too few ants (3 x 25 foodchips = 75 cells) to collect the food.
Keeping ant population fixed at 250: Pheromone ratio (exogenously added/fraction added by each termite) has a more dramatic effect on collection times. Increasing this ratio by a factor of 10, from 0.01 to 0.1 reduces the collection time by a similar factor. However further increases in pheromone ratio has diminishing effect on collecting times.
Some Interesting Cases:
Very low pheromone in nest (exogRate = 0.01) and very high PhAddedbyTermite (>0.5) leads to termites eating food where they find it! The converse, very high nest pheromone (0.999) and very low added pheromone (<0.01) moves the food most rapidly < 800 ticks Intermediate values for these parameters usually lead to cases where order of food collection is always E – S – NW
Small world - Ants move strait to nest
/users/jtfogle/project1/project1.2/bin/guirun.sh X=21 Y=21 nT=2 fdX=5 fdY=5 eR=.99 dK=.9 exogR=.3
Big world - Ants move to the upper left corner, unless torus world is turned on.
/users/jtfogle/project1/project1.2/bin/guirun.sh X=50 Y=50 nT=2 fdX=5 fdY=5 eR=.99 dK=.9 exogR=.3
Big world More Ants - Ants stop picking up food after 13 pieces of food are picked up.
/users/jtfogle/project1/project1.2/bin/guirun.sh X=50 Y=50 nT=50 fdX=5 fdY=5 eR=.99 dK=.9 exogR=.3
Typical - Ants pick up and put down food if next to food pile. Ants also cluster about each other, pheromone secretion works. When clustering the ants hold onto their food.
/users/jtfogle/project1/project1.3/bin/guirun.sh X=50 Y=50 nT=25 fdX=5 fdY=5 nX=20 nY=30 eR=.99 dK=.95 exogR=.9
Nest close - Moved the nest close to test if the ants will put the food down at the nest.
users/jtfogle/project1/project1.4/bin/guirun.sh X=50 Y=50 nT=25 fdX=5 fdY=5 nX=10 nY=15 eR=.99 dK=.95 exogR=.3
Nest far - Moved the nest close to test if the ants will put the food down at the nest. Ants move to the upper left corner again, not to the nest, but with torus world turned on the move to the nest and drop food.
users/jtfogle/project1/project1.4/bin/guirun.sh X=50 Y=50 nT=25 fdX=5 fdY=5 nX=45 nY=45 eR=.99 dK=.95 exogR=.3
More ants + food - crashes the model – out of bounds exception
users/jtfogle/project1/project1.4/bin/guirun.sh X=50 Y=50 nT=65 fdX=10 fdY=5 nX=45 nY=45 eR=.99 dK=.95 exogR=.7
for more project notes- /users/jtfogle/project1/project notes.txt
Build 2.0 (FINAL RUN)
Three food piles one due South of central nest, one due East and one NW. Ants collect food and drop it into the nest.
BRing home the bacon ...
/users/bdeshpan/CSCS530-Java/Project1_Deshpande_Fogle/bin/guirun.sh nT=100 eR=0.99 dK=0.99 addFrac=0.02 exogR=0.6
LIVE where you EAT ...
/users/bdeshpan/CSCS530-Java/Project1_Deshpande_Fogle/bin/guirun.sh nT=100 eR=0.99 dK=0.99 addFrac=10 exogR=0.01
Generally go crazy ...
/users/bdeshpan/CSCS530-Java/Project1_Deshpande_Fogle/bin/guirun.sh nT=100 eR=0.99 dK=0.99 addFrac=.001 exogR=1