
FIND INSTRUCTION REFERENCE
What follows is a reference guide for the instructions that are used by the Find Dialog.
The core KFORTH instructions (like dup, pop, +, *, /, etc..) are covered here.
- ID
- PARENT1
- PARENT2
- STRAIN
- ENERGY
- GENERATION
- NUM-CELLS
- AGE
- NCHILDREN
- EXECUTING
- NUM-CB
- NUM-DEAD
- MAX-ENERGY
- MIN-ENERGY
- AVG-ENERGY
- MAX-AGE
- MIN-AGE
- AVG-AGE
- MAX-NUM-CELLS
INSTRUCTION | USAGE | DESCRIPTION |
ID | ( -- id) | The organism ID. Because organism ID's are large integers, and KFORTH can only handle 16-bit numbers, the organism ID is
modulos 10,000. Example: an organism id of 10,062,527 becomes 2527 with this instruction. |
PARENT1 | ( -- parent1) | The parent1 ID. Because organism ID's are large integers, and KFORTH can only handle 16-bit numbers, the organism ID is
modulos 10,000. Example: a parent id 1 of 10,062,527 becomes 2527 with this instruction. |
PARENT2 | ( -- parent2) | The parent2 ID. Because organism ID's are large integers, and KFORTH can only handle 16-bit numbers, the organism ID is
modulous 10,000. Example: a parent id 2 of 10,062,527 becomes 2527 with this instruction. |
STRAIN | ( -- strain) | The strain number. A number between 0 and 7. |
ENERGY | ( -- e) | The energy of the organism. If the energy is more than 32,767 then this instruction returns 32,767. |
GENERATION | ( -- g) | The generation. If the generation is more than 32,767 then this instruction returns 32,767. |
NUM-CELLS | ( -- n) | The number of cells that the organism consists of. |
AGE | ( -- n) | The age of the organism dividied by 1000. If this is more than 32,767 then this instruction returns 32,767. |
NCHILDREN | ( -- n) | The number of living children. We scan the simulation and count the number of organisms that have this organism as its parent1 or parent2. |
EXECUTING | (cb -- bool) | Does organism have a cell currently executing inside code block 'cb'? Returns 1 or 0. |
NUM-CB | ( -- n) | The total number of code blocks the organism has. |
NUM-DEAD | ( -- n) | The number of cells that have just died (colored red). |
MAX-ENERGY | ( -- e) | Constant: for all organisms return the MAXIMUM energy amount. |
MIN-ENERGY | ( -- e) | Constant: for all organisms return the MINIMUM energy amount. |
AVG-ENERGY | ( -- e) | Constant: for all organisms return the AVERAGE energy amount |
MAX-AGE | ( -- n) | Constant: for all organisms return the MAXIMUM age (divided by 1,000). |
MIN-AGE | ( -- n) | Constant: for all organisms return the MINIMUM age (divided by 1,000). |
AVG-AGE | ( -- n) | Constant: for all organisms return the AVERAGE age (divided by 1,000). |
MAX-NUM-CELLS | ( -- n) | Constant: for all organisms return the MAXIMUM number of cells an organism has. |
ID
Usage: ( -- id)the organism ID (modulos 10,000).
The organism ID. Because organism ID's are large integers, and KFORTH can only handle 16-bit numbers, the organism ID is modulos 10,000.
Example: an organism id of 10,062,527 becomes 2527 with this instruction.
RETURNS:
ENERGY:
the parent1 ID (modulos 10,000) The parent1 ID. Because organism ID's are large integers, and KFORTH can only handle 16-bit numbers, the organism ID is
modulos 10,000.
Example: a parent id 1 of 10,062,527 becomes 2527 with this instruction.
RETURNS: ENERGY: the parent2 ID (modulos 10,000) The parent2 ID. Because organism ID's are large integers, and KFORTH can only handle 16-bit numbers, the organism ID is
modulous 10,000.
Example: a parent id 2 of 10,062,527 becomes 2527 with this instruction.
RETURNS: ENERGY: the strain number The strain number. A number between 0 and 7. RETURNS: ENERGY: the energy of the organism The energy of the organism. If the energy is more than 32,767 then this instruction returns 32,767. RETURNS: ENERGY: the generation. The generation. If the generation is more than 32,767 then this instruction returns 32,767. RETURNS: ENERGY: the number of cells that the organism consists of. The number of cells that the organism consists of. RETURNS: ENERGY: the age of the organism (divided by 1,000). The age of the organism dividied by 1000. If this is more than 32,767 then this instruction returns 32,767. RETURNS: ENERGY: the number of living children. The number of living children. We scan the simulation and count the number of organisms that have this organism as
its parent1 or parent2. RETURNS: ENERGY: Does organism have a cell currently executing inside code block 'cb'? Does organism have a cell currently executing inside code block 'cb'? Returns 1 or 0. RETURNS: ENERGY: the total number of code blocks the organism has. The total number of code blocks the organism has. RETURNS: ENERGY: the number of cells that have just died (colored red). The number of cells that have just died (colored red). RETURNS: ENERGY: Constant: for all organisms return the MAXIMUM energy amount Constant: for all organisms return the MAXIMUM energy amount. RETURNS: ENERGY: Constant: for all organisms return the MINIMUM energy amount Constant: for all organisms return the MINIMUM energy amount. RETURNS: ENERGY: Constant: for all organisms return the AVERAGE energy amount Constant: for all organisms return the AVERAGE energy amount RETURNS: ENERGY: Constant: for all organisms return the MAXIMUM age (divided by 1,000). Constant: for all organisms return the MAXIMUM age (divided by 1,000). RETURNS: ENERGY: Constant: for all organisms return the MINIMUM age (divided by 1,000). Constant: for all organisms return the MINIMUM age (divided by 1,000). RETURNS: ENERGY:PARENT1
Usage: ( -- parent1)PARENT2
Usage: ( -- parent2)STRAIN
Usage: ( -- strain)ENERGY
Usage: ( -- e)GENERATION
Usage: ( -- g)NUM-CELLS
Usage: ( -- n)AGE
Usage: ( -- n)NCHILDREN
Usage: ( -- n)EXECUTING
Usage: (cb -- bool)NUM-CB
Usage: ( -- n)NUM-DEAD
Usage: ( -- n)MAX-ENERGY
Usage: ( -- e)MIN-ENERGY
Usage: ( -- e)AVG-ENERGY
Usage: ( -- e)MAX-AGE
Usage: ( -- n)MIN-AGE
Usage: ( -- n)