(C++)  1.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::evolution::Crossover Struct Reference

Public Member Functions

 Crossover (double crossoverIndividualRate=0.45, CrossoverSelectionType selectionType=CrossoverSelectionType::PSEUDO_ROULETTE, double pseudoRouletteRandomPortion=0.3, double crossoverPhaseRate=1.0, std::mt19937_64::result_type seed=std::random_device{}())
 
void perform (const std::vector< std::unique_ptr< EvoScript >> &inputPopulation)
 

Public Attributes

std::vector< std::unique_ptr< EvoScript > > populationAfter {}
 
double CrossoverIndividualRate = 0.0
 
CrossoverSelectionType SelectionType = CrossoverSelectionType::RANDOM
 
double PseudoRouletteRandomPortion = 0.0
 
double CrossoverPhaseRate = 0.0
 

Protected Member Functions

virtual void crossoverFunctionOnePoint (EvoScript &individual1, EvoScript &individual2)
 
virtual void crossoverFunctionMultiPoint (EvoScript &individual1, EvoScript &individual2, size_t length)
 
virtual void crossoverIndividuals (EvoScript &individual1, EvoScript &individual2)
 

Protected Attributes

std::mt19937_64 randGen
 

Member Data Documentation

double grail::evolution::Crossover::CrossoverIndividualRate = 0.0

Average rate of crossover. If N is the population.size(), then around (N*crossoverIndividualRate) children will be produced.

double grail::evolution::Crossover::CrossoverPhaseRate = 0.0

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.

double grail::evolution::Crossover::PseudoRouletteRandomPortion = 0.0

Pseudoroullete selects pseudoRouletteRandomPortion individuals at random and 1-pseudoRouletteRandomPortion according to roulette.

CrossoverSelectionType grail::evolution::Crossover::SelectionType = CrossoverSelectionType::RANDOM

The method that chooses parents to be recombined.


The documentation for this struct was generated from the following files: