Last updated: January 6, 2007
Evolve 4.0
VOLVE    4.0

Vision Data Dialog

This dialog looks at the 8 direction surrounding a cell and displays what the vision related KFORTH instructions will return.

The cell is shown in the middle of the dialog. Surrounding the cell are the results from looking along each of the 8 directions. Shown is the distance (the WHERE value) and the type of thing seen (WHAT value).

The instructions LOOK, WHAT, WHERE, NEAREST, NEAREST2, FARTHEST, and FARTHEST2. will be using the same information as is displayed in this dialog. This dialog will help in debugging organisms.

Examples

Here's some KFORTH instructions and what they will return, assuming the data shown above.


      1 NEAREST		; returns (-1, 1)

The mask is '1' meaning find the nearest CELL. Which would be direction (-1, 1). There are three cells visible to this cell, and the one at (-1, 1) has the smallest distance; 29.


      3 NEAREST		; returns (-1, -1)

The mask is '3' meaning find the nearest CELL or SPORE. Which would be direction (-1, -1) as the distance 11 is the smallest containing a SPORE.


      8 FARTHEST	; returns (1, 1)

The mask is '8' meaning find the farthest BARRIER. Which would be direction (1, 1) as the distance 43 is the largest distance. This is a "tie" condition; FARTHEST/NEAREST look at each direction in clock-wise order beginning with a RANDOM direction. So the result may differ.


      1 -1 WHERE	; returns 46.

The WHERE instruction returns the distance value for the what is seen along direction (1, -1). The result would be 46.


      0 1 WHAT		; returns 8.

The WHAT instruction returns the type of thing seen (a 'what' value). In this case it returns 8, because the along direction (0, 1) we see a barrier. And a BARRIER's 'what' value is 8.


      15 NEAREST		; returns (-1, -1)

The NEAREST and FARTHEST instructions take a mask, so OR'ing 1, 2, 4, and 8 is "everything". The OR'ing of all what-values is 15. This instruction therefore will return the direction to nearest CELL, SPORE, ORGANIC, or BARRIER. The result is direction (-1, -1) because 11 is the smallest distance.


      15 FARTHEST		; returns (1, 0)

Here we get (1, 0). Looing along direction (1, 0) we see something at a distance of 87. This is the largest distance.