4. Simulation Results
The image below is the CA space for this project. It is the same as the image on page one of this tutorial, except for the difference in color for the 'M' and the 'F'. They have been highlighted in white just to make them easier to see in this tutorial. Again, this is only for the use of the tutorial. The 'M' and 'F' will not appear in this color in the downloaded version of this project.
Notice the epoch is at 0. Once the rule has been compiled and the epoch has been advanced to 1, the image below will appear. Again the color of the mouse and the food will appear in white only for this tutorial.
Concentrating on only the section of the CA space that has the mouse in it, notice that behind the 'M' is a down-arrow 'V'. That is the direction field. To see it more clearly, use the fields tool and unclick the mouse fields in order to only see the direc fields.
Return to the previous screen by enabling the mouse fields again with the fields tool. The direc field is showing a down-arrow. That is due to the rule, specifically lines 12 and 14. Line 12 starts with the rotated if and is looking for a neighbor that has a mouse value of '.' and a direc value of '.'. That is exactly what the cell below the mouse is. It has a zero value for the mouse field and a zero value for the direc field. It is considered a dead cell. So the mouse sees that it can go in that direction. But before it assigns that cell the value of 'M', it sets it's own direc value to '^'.
12 |
else rot if ((no:mouse=='.' || no:mouse=='F') && no:direc=='.') |
13 |
// check empty neighbors |
14 |
direc='^'; // find one, so set the direction |
Advance the epoch to 2 and it will show the mouse appears to move to the cell below it. Actually it doesn't move. But the cell that was the mouse, now has a value of '.' for the mouse field and the cell below it now has a value of 'M'. They traded values as a result of the rule.
Using the fast forward controls, let the program run and watch as the mouse searches for the food and once it finds it, the program stops with the mouse changing to the value of 'V' for victory. The green trail shows the path the mouse has taken and the values of 'd' show any dead-ends the mouse may have encountered along the way.
|