The Genome in Dawkins' Colour Biomorphs
chromosome = array[1..9] of INTEGER;
Compass = (NorthSouth, EastWest);
CompletenessType = (Single, Double);
SpokesType = (NorthOnly, NSouth, Radial);
LimbType = (Stick, Oval, Rectangle);
LimbFillType = (Open, Filled);
person = record
gene: chromosome;
colorgene: array[1..8] of Longint;{index in clut}
BackColorGene: LongInt;{index in clut}
dgene: array[1..10] of SwellType;
SegNoGene: INTEGER;
SegDistGene: INTEGER;
CompletenessGene: CompletenessType;
SpokesGene: SpokesType;
tricklegene, mutsizegene, mutprobgene: INTEGER;
LimbShapeGene: LimbType;
LimbFillGene: LimbFillType;
ThicknessGene: INTEGER;
bioPicture: picHandle;
end;
Gene validation rules in Dawkins' Colour Biomorphs
Color Genes
Integer values range from 0 to rainbow(), which calculates
the number of available colors based on pixel depth according
to the function 2^p - 1 where p is the pixel depth in bits. Check
occurs in reproduce().
Genes 1-8 (IntegerGradientGene)
In DeliverSaltation(), if the gradient is Shrink or Swell,
the value must fall in [-9 * TrickleGene, 9 * TrickleGene].
Both gradient and value are randomised until this condition is
satisfied.
Gene 9
Integer from 1 to 8: check occurs in reproduce().
In DeliverSaltation(), gene9 is randomised to a value from [1,6],
and a check is made to make sure that the value is greater than 1,
which is unnecessary given that the RandInt() function can only
return positive values.
MutProbGene
A positive percentage: acceptable values are 1 to 100.
Checks occur in reproduce().
MutSizeGene
Positive integer: test occurs in reproduce().
In DeliverSaltation(), After TrickleGene is randomised,
MutSizeGene is set to half whatever TrickleGene is,
provided the result is nonzero.
TrickleGene := 1 + randint(100) div 10;
if TrickleGene > 1 then
MutSizeGene := Tricklegene div 2
ThicknessGene
Positive integer: test occurs in reproduce().
TrickleGene
Positive integer: test occurs in reproduce();
SegDistGene gradient
In DeliverSaltation(), gradient is randomised. The
resulting gradient may be Shrink or Swell, unless
the integer value, multiplied by SegNoGene, would then fall outside [-100,100].
SegNoGene
Positive integer: test occurs in reproduce().
Gene validation rules which violate the Central Dogma
In develop(), check and force SegNoGene to be 1 or greater.