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

Public Member Functions

 Mutation (double mutationPhaseRate=1.0, double mutateIndividualRate=0.09, double mutateChromosomeRate=0.5, bool mutateBothParentsAndChildren=true, std::mt19937_64::result_type seed=std::random_device{}())
 
virtual void Perform (const std::vector< std::unique_ptr< EvoScript >> &parentPopulation, const std::vector< std::unique_ptr< EvoScript >> &childrenPopulation)
 

Public Attributes

std::vector< std::unique_ptr< EvoScript > > populationAfter {}
 
double MutationPhaseRate = 0.0
 
double MutateIndividualRate = 0.0
 
double MutateChromosomeRate = 0.0
 
bool MutateBothParentsAndChildren = false
 
MutationSelectionType RandomResolutionTypeForIndividual = MutationSelectionType::SELECT_P_OF_N
 
MutationSelectionType RandomResolutionTypeForChromosome = MutationSelectionType::SELECT_P_OF_N
 

Protected Member Functions

virtual void MutateIndividual (EvoScript &individual)
 
virtual void MutateChromosome (EvoScript &individual, EvoParam &chromosome)
 

Protected Attributes

std::mt19937_64 randGen
 

Member Data Documentation

◆ MutateBothParentsAndChildren

bool grail::evolution::Mutation::MutateBothParentsAndChildren = false

If true: both the previous population and children can be mutated; if false: only the individuals after crossover can be mutated.

◆ MutateChromosomeRate

double grail::evolution::Mutation::MutateChromosomeRate = 0.0

Probability that a chromosome of an individual will be considered for mutation (randomResolutionTypeForChromosome == ITERATE_AND_TEST_P); or the portion of chromosomes within an individual chosen for mutation (randomResolutionTypeForChromosome == SELECT_P_OF_N).

◆ MutateIndividualRate

double grail::evolution::Mutation::MutateIndividualRate = 0.0

Probability that an individual will be considered for mutation (randomResolutionTypeForIndividual == ITERATE_AND_TEST_P); or the portion of individuals chosen for mutation (randomResolutionTypeForIndividual == SELECT_P_OF_N).

◆ MutationPhaseRate

double grail::evolution::Mutation::MutationPhaseRate = 0.0

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


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