GEP::Core::Common::Genotype Class Reference

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

Inheritance diagram for GEP::Core::Common::Genotype:

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

Collaboration graph

List of all members.

Public Member Functions

 Genotype (Population population)
 Creates a genotype based on the supplied population .
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 .
abstract Genotype Clone ()
 Creates a shallow copy of the current instance.
abstract Common.Genotype CloneWithoutLinearStructure ()
 Same as Clone, but the _linearStructure is only created, not copied.
override string ToString ()
abstract int IsValid ()
 Checks if in the tail and constants section all Symbols accept 0 Symbol.N_Parameters.
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

Symbol[][] _linearStructure
 The genome of this genotype.

Protected Member Functions

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

Protected Attributes

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 class is a centerpiece of GEP .NET Framework.

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 20 of file Genotype.cs.

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