### Ant Food Collection Genetic ProgramResults

Note: There are slight variations from these inputs parameter names, graphics, results... below and the current software available for download. These results are from the original version of the software more than 20 years ago.

### Simple Food Collection Problem

#### Parameters

 POPULATION_SIZE 500 TOURNAMENT_SIZE 4 FOOD_LEFT_WEIGHT 10000000 FOOD_UNFOUND_WEIGHT 100000 TIME_WEIGHT 1 NODE_WEIGHT 10000 NODE_GROUP 50 LEAF_ODDS 9 NON_LEAF_ODDS 6 MUTATE_ODDS 100 PERCENT_GREEDY_MUTATE 80 MAX_TURNS 500 NUM_ANTS 15 GOAL_FITNESS 0 POP_SEED 1 INTERP_SEED 0 PHEROMONE_STRENGTH 300 PHEROMONE_SPREAD 20 WAIT_ODDS 0 AUTO_FOOD_DROP 1 DEBUG 0 SHOW_TIME 100 DUMP 10000 MAX_ITERATIONS 2500 RESTORE_ITERATION 0 RESTORE_VERSION 0 RESTORE_AMOUNT 0 INSTRUCTION_VERSION 1 MAP_VERSION 1 VERSION 14

;

#### Instruction Set

 MOVE QUASI RANDOM MOVE TO NEST PICK UP FOOD RELEASE PHEROMONE PROC2 IF ( CARRYING FOOD ) THEN IF ( MOVE TO ADJACENT FOOD ) THEN IF ( MOVE TO AWAY PHEROMONE ) THEN

;

#### Best Solution

```Iteration =   2481, Time = Wed Mar  5 19:20:33, Fitness =  20200500,
Number of Nodes =   9, Number of Turns =  500,
IF ( CARRYING FOOD ) THEN
RELEASE PHEROMONE
MOVE TO NEST
ELSE
IF ( MOVE TO AWAY PHEROMONE ) THEN
PICK UP FOOD
ELSE
MOVE QUASI RANDOM
PICK UP FOOD
```

#### Description of Best Solution

1. First, the ants moved around randomly, until one of them finds food.
2. When an ant finds food, it moves directly to the nest, releasing pheromones as it moves.
3. Other ants will detect the pheromone trail, and follow it to the pile of food.

### Water Crossing Food Collection Problem

#### Parameters

 POPULATION_SIZE 500 TOURNAMENT_SIZE 4 FOOD_LEFT_WEIGHT 10000000 FOOD_UNFOUND_WEIGHT 100000 TIME_WEIGHT 1 NODE_WEIGHT 10000 NODE_GROUP 50 LEAF_ODDS 9 NON_LEAF_ODDS 6 MUTATE_ODDS 100 PERCENT_GREEDY_MUTATE 80 MAX_TURNS 1000 NUM_ANTS 100 GOAL_FITNESS 0 POP_SEED 0 INTERP_SEED 0 PHEROMONE_STRENGTH 400 PHEROMONE_SPREAD 20 WAIT_ODDS 0 AUTO_FOOD_DROP 1 DEBUG 0 SHOW_TIME 100 DUMP 10000 MAX_ITERATIONS 2500 RESTORE_ITERATION 0 RESTORE_VERSION 0 RESTORE_AMOUNT 0 INSTRUCTION_VERSION 15 MAP_VERSION 15 VERSION 17

;

#### The instruction set was:

 MOVE QUASI RANDOM MOVE TO NEST THROUGH WATER PICK UP FOOD RELEASE PHEROMONE MOVE INTO WATER PROC2 IF ( CARRYING FOOD ) THEN IF ( MOVE TO ADJACENT FOOD ) THEN IF ( MOVE TO AWAY PHEROMONE ) THEN IF ( MOVE TO DEAD ANT ) THEN IF ( WATER AHEAD ) THEN IF ( ANOTHER ANT HERE ) THEN

;

#### Best Solution

```Iteration =   2154, Time = Thu Mar 13 00:10:31, Fitness =     10297,
Number of Nodes =  53, Number of Turns =  297,
IF ( MOVE TO DEAD ANT ) THEN
RELEASE PHEROMONE
ELSE
PICK UP FOOD
IF ( MOVE TO AWAY PHEROMONE ) THEN
IF ( CARRYING FOOD ) THEN
IF ( WATER AHEAD ) THEN
MOVE QUASI RANDOM
ELSE
MOVE TO NEST THROUGH WATER
IF ( MOVE TO ADJACENT FOOD ) THEN
MOVE TO NEST THROUGH WATER
ELSE
RELEASE PHEROMONE
ELSE
IF ( CARRYING FOOD ) THEN
MOVE QUASI RANDOM
ELSE
IF ( MOVE TO ADJACENT FOOD ) THEN
IF ( WATER AHEAD ) THEN
IF ( MOVE TO ADJACENT FOOD ) THEN
PICK UP FOOD
ELSE
PICK UP FOOD
ELSE
RELEASE PHEROMONE
ELSE
IF ( CARRYING FOOD ) THEN
IF ( ANOTHER ANT HERE ) THEN
MOVE INTO WATER
ELSE
MOVE QUASI RANDOM
ELSE
IF ( WATER AHEAD ) THEN
MOVE TO NEST THROUGH WATER
ELSE
RELEASE PHEROMONE
IF ( CARRYING FOOD ) THEN
IF ( MOVE TO DEAD ANT ) THEN
IF ( WATER AHEAD ) THEN
MOVE TO NEST THROUGH WATER
ELSE
MOVE QUASI RANDOM
ELSE
IF ( MOVE TO ADJACENT FOOD ) THEN
IF ( MOVE TO AWAY PHEROMONE ) THEN
IF ( CARRYING FOOD ) THEN
MOVE TO NEST THROUGH WATER
ELSE
IF ( ANOTHER ANT HERE ) THEN
PICK UP FOOD
ELSE
MOVE TO NEST THROUGH WATER
IF ( ANOTHER ANT HERE ) THEN
MOVE QUASI RANDOM
ELSE
MOVE INTO WATER
ELSE
MOVE TO NEST THROUGH WATER
ELSE
MOVE INTO WATER
ELSE
PICK UP FOOD
ELSE
MOVE INTO WATER
IF ( MOVE TO ADJACENT FOOD ) THEN
RELEASE PHEROMONE
ELSE
MOVE QUASI RANDOM
```

#### Description of Best Solution

1. First, the ants move around randomly, moving into water if it is in front of them.
2. When an ant finds another dead ant, it releases pheromones, and moves forward into water. This creates a bridge across a stream of width 2
3. Other ants pick up on the pheromone scent, and crossed the water without dying. When an ants smells pheromones, it will follow them, and not move into the water When other ants see dead ants or smell pheromones, they will also leave pheromones.
4. When the ants that have crossed the water find food, they will pick it up and move to an adjacent piece of food. The ant with food will continually move between two adjacent pieces of food until one of them is removed. While moving back and forth, the ant will release pheromones.
5. Other ants will follow these pheromones, and pick up the food under the ant moving back and forth. When this food is gone, that ant is freed to go back to the nest. It will do a drunken walk to the nest.
6. On the way to the nest, if it encounters water, it will move into the water, dropping the food where it died. Other ants will find this food and bring it to the nest.

### Water Crossing & Heavy Food Collection Problem

#### Parameters

 POPULATION_SIZE 600 TOURNAMENT_SIZE 4 FOOD_LEFT_WEIGHT 10000000 FOOD_UNFOUND_WEIGHT 100000 TIME_WEIGHT 1 NODE_WEIGHT 10000 NODE_GROUP 50 LEAF_ODDS 9 NON_LEAF_ODDS 6 MUTATE_ODDS 100 PERCENT_GREEDY_MUTATE 80 MAX_TURNS 3000 NUM_ANTS 40 GOAL_FITNESS 0 POP_SEED 0 INTERP_SEED 0 PHEROMONE_STRENGTH 500 PHEROMONE_SPREAD 60 WAIT_ODDS 50 AUTO_FOOD_DROP 1 DEBUG 0 SHOW_TIME 100 DUMP 10000 MAX_ITERATIONS 2000 RESTORE_ITERATION 1500 RESTORE_VERSION 17 RESTORE_AMOUNT 100 INSTRUCTION_VERSION 33 MAP_VERSION 33 VERSION 35

;

#### Instruction Set

 MOVE QUASI RANDOM MOVE TO NEST MOVE TO NEST THROUGH WATER PICK UP FOOD RELEASE PHEROMONE MOVE INTO WATER ESCAPE PHEROMONE PROC2 IF ( FOOD HERE ) THEN IF ( CARRYING FOOD ) THEN IF ( MOVE TO ADJACENT FOOD ) THEN IF ( MOVE TO AWAY PHEROMONE ) THEN IF ( MOVE TO ADJACENT PHEROMONE ) THEN IF ( MOVE TO DEAD ANT ) THEN IF ( MOVE TO NEST ) THEN IF ( TIRED OF WAITING ) THEN

;

#### Best Solution

```Iteration =   1858, Time = Wed Apr 23 01:37:11, Fitness =     11953,
Number of Nodes =  87, Number of Turns = 1953,
IF ( CARRYING FOOD ) THEN
MOVE TO NEST
ELSE
RELEASE PHEROMONE
MOVE QUASI RANDOM
IF ( MOVE TO ADJACENT FOOD ) THEN
PICK UP FOOD
ELSE
IF ( MOVE TO ADJACENT FOOD ) THEN
RELEASE PHEROMONE
ELSE
MOVE QUASI RANDOM
IF ( MOVE TO ADJACENT FOOD ) THEN
RELEASE PHEROMONE
IF ( ANOTHER ANT HERE ) THEN
MOVE INTO WATER
ELSE
RELEASE PHEROMONE
ELSE
MOVE QUASI RANDOM
IF ( MOVE TO ADJACENT FOOD ) THEN
PICK UP FOOD
ELSE
IF ( MOVE TO ADJACENT FOOD ) THEN
MOVE INTO WATER
ELSE
IF ( FOOD HERE ) THEN
IF ( CARRYING FOOD ) THEN
IF ( MOVE TO ADJACENT FOOD ) THEN
ESCAPE PHEROMONE
ELSE
MOVE TO NEST
ELSE
MOVE TO NEST
ELSE
IF ( MOVE TO AWAY PHEROMONE ) THEN
IF ( MOVE TO DEAD ANT ) THEN
MOVE INTO WATER
ELSE
MOVE QUASI RANDOM
ELSE
IF ( WATER AHEAD ) THEN
IF ( MOVE TO NEST ) THEN
IF ( FOOD HERE ) THEN
IF ( CARRYING FOOD ) THEN
IF ( MOVE TO ADJACENT FOOD ) THEN
ESCAPE PHEROMONE
ELSE
MOVE TO NEST
ELSE
RELEASE PHEROMONE
ELSE
IF ( MOVE TO AWAY PHEROMONE ) THEN
IF ( FOOD HERE ) THEN
MOVE INTO WATER
ELSE
MOVE INTO WATER
ELSE
MOVE TO NEST
ELSE
IF ( FOOD HERE ) THEN
IF ( MOVE TO AWAY PHEROMONE ) THEN
PICK UP FOOD
ELSE
IF ( CARRYING FOOD ) THEN
IF ( MOVE TO NEST ) THEN
PICK UP FOOD
ELSE
IF ( MOVE TO ADJACENT PHEROMONE ) THEN
IF ( MOVE TO AWAY PHEROMONE ) THEN
IF ( MOVE TO ADJACENT FOOD ) THEN
ESCAPE PHEROMONE
ELSE
MOVE TO NEST
ELSE
IF ( MOVE TO AWAY PHEROMONE ) THEN
MOVE INTO WATER
ELSE
MOVE INTO WATER
ELSE
PICK UP FOOD
ELSE
MOVE TO NEST
RELEASE PHEROMONE
ELSE
IF ( MOVE TO DEAD ANT ) THEN
PICK UP FOOD
ELSE
MOVE QUASI RANDOM
ELSE
IF ( MOVE TO ADJACENT FOOD ) THEN
PICK UP FOOD
ELSE
MOVE INTO WATER
IF ( MOVE TO ADJACENT FOOD ) THEN
MOVE QUASI RANDOM
IF ( ANOTHER ANT HERE ) THEN
PICK UP FOOD
ELSE
RELEASE PHEROMONE
ELSE
MOVE QUASI RANDOM
MOVE QUASI RANDOM
IF ( MOVE TO ADJACENT FOOD ) THEN
PICK UP FOOD
ELSE
IF ( MOVE TO ADJACENT FOOD ) THEN
MOVE INTO WATER
ELSE
MOVE QUASI RANDOM
```

#### Description of Best Solution

1. First, the ants move around randomly. Every move, the ants release pheromones. This will quickly fill the map with pheromones.
2. When an ant finds food, it picks up the food and waits for other ants to help lift it.
3. When an ant sees water, if there are no pheromones present ( the ant is just outside the pheromone cloud ), then the ant will move into the water.
4. The pheromones will quickly reach the water, and soon no ants will be able to move into the water. To complete a bridge, if an ant is at a dead ant, and another ant is present, then one of the ants will move forward into the water, completing the bridge. Otherwise, ants will not move into water when pheromones are present.
5. When ants find food, on either side of the water, they pick up the food, and wait for help from other ants, while releasing pheromones. When there are enough ants, they all do a drunken walk back to the nest. If need be, the ants will build another bridge on the way back to the nest.