Public Member Functions | |
Population (int n_Genes, int headLength, int n_generations, Alphabet functionsSet, Alphabet variablesSet, Alphabet constantsSet, double[] symbolSetsProbabilityDistribution, Symbol genesLinkingFunction, OperatorsSet operators) | |
abstract void | Initialize (int populationSize) |
Initializes a population of Genotypes with random genome. | |
void | UpdateSymbolRefereces (Alphabet functionsSet, Alphabet variablesSet, Alphabet constantsSet) |
Updates Symbol references from every Genotype._linearStructure in this population to point to symbols from the provided alphabets. | |
void | NextGeneration () |
Creates the next generation in this population. | |
void | CalculateFitnessAndMatingProbabilities () |
Calculates and assigns fitnesses and mating probability to Genotypes from this population. | |
void | Start () |
Starts the evolution of the population. | |
void | AutoSave () |
Auto saves the current population. | |
void | Save (string filePath) |
Saves the current population. | |
Static Public Member Functions | |
static Population | Load (string filePath) |
Loads a population from a file. | |
Public Attributes | |
GenerationCalculatedCallback | _generationCalculatedCallback |
int | _n_generations |
The maximum number of generations this population will evolve. | |
string | _autoSaveFilePath |
The path to the file to auto save the population. | |
int | _autoSaveInterval |
The interval in minutes between auto saves. | |
DateTime | _previousAutoSave = DateTime.Now |
The previous auto save time. | |
List< Genotype > | _fittestList = new List<Genotype>(20) |
List of fittest Genotypes that have occurred during evolution. | |
Protected Member Functions | |
abstract void | MutateConstants () |
Mutates values of constants in the _constantsSet. | |
Protected Attributes | |
Random | _random = new Random() |
Since on some places random numbers are requred, every population has its own Random. | |
Genotype | _fittest |
int | _generation |
Symbol | _genesLinkingFunction |
Alphabet | _functionsSet |
Alphabet | _variablesSet |
Alphabet | _constantsSet |
double[] | _symbolSetsProbabilityDistribution |
Array with two elements. It is the cumulative probability of the functions, variables and constants sets respective to the elements of the array. | |
int | _n_Genes |
int | _geneLength |
int | _headLength |
int | _tailLength |
int | _genotypeLength |
Properties | |
Genotype | Fittest [get] |
The current fittest Genotype in the whole population. | |
int | N_generations [get] |
Gets the number of generations that have to evolve. | |
int | Size [get] |
Gets the number of Genotypes in this population. | |
double | TotalMatingProbability [get] |
The total mating probability of all Genotypes in this population. | |
Genotype | this [int genotypeIndex] [get, set] |
Gets or sets a genotype from / in this population. | |
int | Generation [get] |
Gets the number of the current generation. The first generation is with number 0. | |
Symbol | GenesLinkingFunction [get] |
Gets the linking function between genes of Genotypes from this population. | |
Alphabet | FunctionsSet [get] |
The set of functions used in Genotypes. | |
Alphabet | VariablesSet [get] |
The set of variables used in Genotypes. | |
Alphabet | ConstantsSet [get] |
The set of constants used in Genotypes. | |
int | N_Genes [get] |
Gets the number of genes each Genotype of this population has. | |
int | GeneLength [get] |
Gets the length of genes each Genotype of this population has. | |
int | HeadLength [get] |
Gets the genes' head length each Genotype of this population has. | |
int | TailLength [get] |
Gets genes' tail length each Genotype of this population has. | |
int | GenotypeLength [get] |
Gets the length of the genome (Genotype._linearStructure, that each genotype in this population has. |
This class is a centerpiece of GEP .NET Framework.
It governs the evolution process.
Definition at line 29 of file Population.cs.