GEP::Core::Float::Genotype Class Reference

The genotype is a function that evlolves to solve the given problem. More...

Inheritance diagram for GEP::Core::Float::Genotype:

Inheritance graph
Collaboration diagram for GEP::Core::Float::Genotype:

Collaboration graph

List of all members.

Public Member Functions

 Genotype (Common.Population population)
 Creates a genotype based on the supplied population .
override Common.Genotype Clone ()
 Creates a shallow copy of the current instance.
override Common.Genotype CloneWithoutLinearStructure ()
 Same as Clone, but the _linearStructure is only created, not copied.
override int IsValid ()
 Checks if in the tail and constants section all Symbols accept 0 Symbol.N_Parameters.
void Initialize (Random random, Alphabet functionsSet, Alphabet variablesSet, Alphabet constantsSet, double[] symbolSetsProbabilityDistribution)
 Initializes the _linearStructure with random values.
void CalculateAll (int variableValuesIndex)
 Calculates all genes and if there is a _genesLinkingFunction, the value of the genotype.
void UpdateSymbolReferences (Alphabet oldAlphabet, Alphabet newAlphabet, int startIndex, int endIndex)
 Updates Symbol references from the _linearStructure to point to symbols from the newAlphabet .
void UpdateFunctionReferences (Alphabet oldFunctions, Alphabet newFunctions)
 Updates Symbol reference from the _linearStructure to point to symbols from the newFunctions .
void UpdateVariableReferences (Alphabet oldVariables, Alphabet newVariables)
 Updates Symbol reference from the _linearStructure to point to symbols from the newVariables .
void UpdateConstantReferences (Alphabet oldConstants, Alphabet newConstants)
 Updates Symbol reference from the _linearStructure to point to symbols from the newConstants .
override string ToString ()
void CloneConstants ()
 Makes a complete copy of all constants in the genome (_linearStructure).

Static Public Member Functions

static void CopyLinearStructure (Genotype source, Genotype destination, int startGene, int endGene, int startIndex, int endIndex)
 Copies a part of the _linearStructure of one genotype to another.

Public Attributes

float[] _geneValues
 The values of genes are stored here after calculation.
float _value
 The value of the genotype. Not applicable if there is no Common.Genotype._genesLinkingFunction.
Symbol[][] _linearStructure
 The genome of this genotype.

Protected Member Functions

 Genotype ()
override void InitializeGeneValuesArray ()
 Initializes the array that will store gene values, when calculated.
override void CalculateValue ()
 Calculates the _genesLinkingFunction with parameters its gene values.
override void CalculateGene (int geneIndex, int variableValuesIndex)
 Calculates a value of a gene for a particular variable case.
void CalculateAllGenes (int variableValuesIndex)
 Calculates the genes of this genotype.

Protected Attributes

float[] _linearStructureValues
 Used as a draft, storing values of Symbols in the gene, during gene values calculation.
int[] _functionStack
 Used to facilitate calculation of genotypes.
int _n_Genes
int _geneLength
int _headLength
int _tailLength
Symbol _genesLinkingFunction
 The linking function of the genotype.


double MatingProbability [get]
 The probability of this genotype to mate when forming the new generation.
double TestFitness [get]
 Here is saved the value after testing the genotype, usually with data that it had not evolved on.
double Fitness [get]
 During evolution / learning genotype's fitness is stored here.
int N_Genes [get]
 The number of genes in the genotype.
int GeneLength [get]
 The number of Symbols in gene.
int HeadLength [get]
 The number of Symbols in the head of a gene.
int TailLength [get]
 The number of Symbols in the tail of a gene.
int GenotypeLength [get]
 Gets the length of the genome.

Detailed Description

The genotype is a function that evlolves to solve the given problem.

This genotype uses numbers of type float.

As described in Candida Ferreira's works, the genotype is the expression tree created from the genome, which is the linear coding of the genotype. Since it will be clumsy to create a genotype structure in memory for every genome, the data is always held in linear form and with a recursive algorithm the final output of the genotype is calculated.

Definition at line 22 of file Genotype.cs.

The documentation for this class was generated from the following file:
GEP .NET Framwork Main Page Logo