Ants_plan_1.doc 10/3/06
Here is my current plan for the program.
Each ant will be tracked by a vector of values, like a database records with fields. Here are the values in the vector, the field names will created later:
In each cycle of the simulation this record will be updated for each ant before the moves are drawn.
For each move the simulation will “sniff” all of the 8 squares adjacent to the current square. Squares off the board will be ignored.
Seeker
If the ant is a seeker, the sniff will identify the square, or squares, with the smallest value for “# of moves from food”.
If there are more than one square with the same smallest value, one of those squares will be chosen at random.
If no adjacent square has a value for “# of moves from food”, the ant will continue in the direction it was going. I.e. the displacement between the next square ( using X Square and Y Sqaure values) and the current square will be the same as between the prior square and the current square.
The result of this is that a seeker ant will move in a straight line unless it finds the trail of a carrier ant.
If the straight line followed by an ant runs into the boundary of the area, and there are no adjacent squares that are part of a carrier trail, the ant will choose a direction at random with the constraints that (a) it wont try to go over the boundary and (b) it wont go back in the exact direction it came from.
I will need to make up a rule for what an ant does on it’s first move leaving home and on its first move leaving food. I suppose it could simply follow the rules above.
After each move, the system will do the following:
If a seeker ant sniffs that there is food on an adjacent square it will move to that square. On the next move it will have become a carrier ant.
Finally, there will be a “wander” factor set for each simulation. This determines what percentage of the time an ant will ignore the above rules and simply wander to any of the 8 adjacent squares that are on the board. I might restrict it from going to the square it just left.
Carrier
The rules for the carrier ant will be almost identical to those of the seeker ant except that it will follow a seeker ant trail if it finds one rather than following a prior carrier ant trail.
If a carrier ant sniffs that the Home Square is one of the adjacent squares, it will move to that square. On the next move it will have become a seeker ant again.
Data on each Square : Record structure for each square.
There will be a record for each square on the board. This will contain the following fields.)
Other data – history.
I think it would be useful to store the starting and ending point of each move, partly because I may want to erase it, and perhaps redraw it later for some move.
The record to keep this data will have the following fields: