Grail (C#)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Evolution.Crossover Class Reference

The Crossover object that encapsulates the crossover operation and its configuration in the evolutionary algorithm. More...

Public Member Functions

void Perform (in List< Individual > constInputPopulation)
 The function that performs the crossover phase. More...
 

Protected Member Functions

virtual void CrossoverIndividuals (Individual individual1, Individual individual2)
 The function that performs a single crossover operation between two individuals. The offspring is added to PopulationAfter. More...
 
void CrossoverFunction_Onepoint (Individual individual1, Individual individual2)
 Implementation of the standard one-point crossover operation. More...
 
void CrossoverFunction_Multipoint (Individual individual1, Individual individual2, int length)
 Implementation of the standard k-point (multi-point) crossover operation. More...
 

Properties

CrossoverSelectionType CrossoverSelectionType [get, set]
 Predefined ways in which individuals are selected from the population for crossover. Please refer to enum values for details about each of them. More...
 
double CrossoverPhaseRate = CrossoverSelectionType.PSEUDO_ROULETTE [get, set]
 The probability of a crossover phase to happen (globally). If a crossover is included in the algorithm, this value should most likely be equal to 1.0. More...
 
double CrossoverIndividualRate = 1.0 [get, set]
 The average rate of the crossover. The expected number of children is: PopulationSize*CrossoverIndividualRate. More...
 
double PseudoRouletteRandomPortion = 0.45 [get, set]
 Used only with PseudoRoulette.
This method selects PseudoRouletteRandomPortion*100% of individuals at random and (1-PseudoRouletteRandomPortion)*100% according to roulette. More...
 
List< IndividualPopulationAfter = 0.3 [get, set]
 The population of children, i.e., after the crossover operation has been performed. More...
 

Detailed Description

The Crossover object that encapsulates the crossover operation and its configuration in the evolutionary algorithm.

Member Function Documentation

◆ CrossoverFunction_Multipoint()

void Grail.Evolution.Crossover.CrossoverFunction_Multipoint ( Individual  individual1,
Individual  individual2,
int  length 
)
inlineprotected

Implementation of the standard k-point (multi-point) crossover operation.

Parameters
individual1The first parent to produce offspring.
individual2The second parent to produce offspring.

◆ CrossoverFunction_Onepoint()

void Grail.Evolution.Crossover.CrossoverFunction_Onepoint ( Individual  individual1,
Individual  individual2 
)
inlineprotected

Implementation of the standard one-point crossover operation.

Parameters
individual1The first parent to produce offspring.
individual2The second parent to produce offspring.

◆ CrossoverIndividuals()

virtual void Grail.Evolution.Crossover.CrossoverIndividuals ( Individual  individual1,
Individual  individual2 
)
inlineprotectedvirtual

The function that performs a single crossover operation between two individuals. The offspring is added to PopulationAfter.

Parameters
individual1The first parent to produce offspring.
individual2The second parent to produce offspring.

◆ Perform()

void Grail.Evolution.Crossover.Perform ( in List< Individual constInputPopulation)
inline

The function that performs the crossover phase.

Parameters
constInputPopulationThe population containing individuals that are candidates for the crossover. This population should not be changed. Instead add the results to PopulationAfter.
Please note that the crossover might not choose all individuals depending on its configuration.

Property Documentation

◆ CrossoverIndividualRate

double Grail.Evolution.Crossover.CrossoverIndividualRate = 1.0
getset

The average rate of the crossover. The expected number of children is: PopulationSize*CrossoverIndividualRate.

◆ CrossoverPhaseRate

double Grail.Evolution.Crossover.CrossoverPhaseRate = CrossoverSelectionType.PSEUDO_ROULETTE
getset

The probability of a crossover phase to happen (globally). If a crossover is included in the algorithm, this value should most likely be equal to 1.0.

◆ CrossoverSelectionType

CrossoverSelectionType Grail.Evolution.Crossover.CrossoverSelectionType
getset

Predefined ways in which individuals are selected from the population for crossover. Please refer to enum values for details about each of them.

◆ PopulationAfter

List<Individual> Grail.Evolution.Crossover.PopulationAfter = 0.3
getset

The population of children, i.e., after the crossover operation has been performed.

◆ PseudoRouletteRandomPortion

double Grail.Evolution.Crossover.PseudoRouletteRandomPortion = 0.45
getset

Used only with PseudoRoulette.
This method selects PseudoRouletteRandomPortion*100% of individuals at random and (1-PseudoRouletteRandomPortion)*100% according to roulette.


The documentation for this class was generated from the following file: