Last updated: February 7th, 2023
Evolve 5.0
VOLVE    5.0

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.


INSTRUCTIONUSAGEDESCRIPTION
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:


PARENT1

Usage: ( -- parent1)

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:


PARENT2

Usage: ( -- parent2)

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:


STRAIN

Usage: ( -- strain)

the strain number

The strain number. A number between 0 and 7.

RETURNS:

ENERGY:


ENERGY

Usage: ( -- e)

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:


GENERATION

Usage: ( -- g)

the generation.

The generation. If the generation is more than 32,767 then this instruction returns 32,767.

RETURNS:

ENERGY:


NUM-CELLS

Usage: ( -- n)

the number of cells that the organism consists of.

The number of cells that the organism consists of.

RETURNS:

ENERGY:


AGE

Usage: ( -- n)

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:


NCHILDREN

Usage: ( -- n)

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:


EXECUTING

Usage: (cb -- bool)

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:


NUM-CB

Usage: ( -- n)

the total number of code blocks the organism has.

The total number of code blocks the organism has.

RETURNS:

ENERGY:


NUM-DEAD

Usage: ( -- n)

the number of cells that have just died (colored red).

The number of cells that have just died (colored red).

RETURNS:

ENERGY:


MAX-ENERGY

Usage: ( -- e)

Constant: for all organisms return the MAXIMUM energy amount

Constant: for all organisms return the MAXIMUM energy amount.

RETURNS:

ENERGY:


MIN-ENERGY

Usage: ( -- e)

Constant: for all organisms return the MINIMUM energy amount

Constant: for all organisms return the MINIMUM energy amount.

RETURNS:

ENERGY:


AVG-ENERGY

Usage: ( -- e)

Constant: for all organisms return the AVERAGE energy amount

Constant: for all organisms return the AVERAGE energy amount

RETURNS:

ENERGY:


MAX-AGE

Usage: ( -- n)

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:


MIN-AGE

Usage: ( -- n)

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:


AVG-AGE

Usage: ( -- n)

Constant: for all organisms return the AVERAGE age (divided by 1,000).

Constant: for all organisms return the AVERAGE age (divided by 1,000).

RETURNS:

ENERGY:


MAX-NUM-CELLS

Usage: ( -- n)

Constant: for all organisms return the MAXIMUM number of cells an organism has.

Constant: for all organisms return the MAXIMUM number of cells an organism has.

RETURNS:

ENERGY: