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

The Mutation object that encapsulates the mutation operation and its configuration in evolutionary algorithm. More...

Inheritance diagram for Grail.Evolution.Mutation:

Public Member Functions

void Perform (in List< Individual > constInputPopulation)
 Attempts to mutate the entire population. The number of mutated individuals is based on mutation phase rate and mutate individual rate. More...
 

Static Public Member Functions

static Mutation CreateIdentityMutation ()
 Creates a mutation, called identity mutation, that does not transform the population in any way. More...
 

Protected Member Functions

virtual void MutateIndividual (Individual individual)
 The function that performs the mutation operation of one individual. More...
 
virtual void MutateGene (Individual individual, BaseEvoParam gene)
 The function that performs the mutation operation of a single parameter within the mutated individual. More...
 

Properties

MutationSelectionType RandomResolutionTypeForIndividual [get, set]
 Specifies how individuals for mutations are chosen. See MutationSelectionType. More...
 
MutationSelectionType RandomResolutionTypeForGene = MutationSelectionType.SELECT_P_OF_N [get, set]
 Specifies how genes in an individual (already chosen for mutation) are chosen for mutation. See MutationSelectionType. More...
 
double MutationPhaseRate = MutationSelectionType.SELECT_P_OF_N [get, set]
 The probability that mutation happens (globally). If a mutation is included in the algorithm, this value should most likely be equal to 1.0. More...
 
double MutationIndividualRate = 1.0 [get, set]
 IF RandomResolutionTypeForIndividual == ITERATE_AND_TEST_P: the probability that an individual will be considered for mutation (RandomResolutionTypeForIndividual == ITERATE_AND_TEST_P);
IF RandomResolutionTypeForIndividual == SELECT_P_OF_N: the portion of individuals chosen for mutation (RandomResolutionTypeForIndividual == SELECT_P_OF_N). More...
 
double MutationGeneRate = 0.09 [get, set]
 IF randomResolutionTypeForGene == ITERATE_AND_TEST_P: the probability that a gene of an individual will be considered for mutation;
IF randomResolutionTypeForGene == SELECT_P_OF_N: the portion of genes within an individual chosen for mutation. More...
 
bool MutateBothParentsAndChildren = 0.5 [get, set]
 If true: both the previous population and children can be mutated; if false: only the individuals after the crossover can be mutated. More...
 

Detailed Description

The Mutation object that encapsulates the mutation operation and its configuration in evolutionary algorithm.

Member Function Documentation

◆ CreateIdentityMutation()

static Mutation Grail.Evolution.Mutation.CreateIdentityMutation ( )
inlinestatic

Creates a mutation, called identity mutation, that does not transform the population in any way.

Returns
Returns the identity mutation.

◆ MutateGene()

virtual void Grail.Evolution.Mutation.MutateGene ( Individual  individual,
BaseEvoParam  gene 
)
inlineprotectedvirtual

The function that performs the mutation operation of a single parameter within the mutated individual.

Parameters
individualThe mutated individual.
geneThe parameter of the individual to be mutated.

◆ MutateIndividual()

virtual void Grail.Evolution.Mutation.MutateIndividual ( Individual  individual)
inlineprotectedvirtual

The function that performs the mutation operation of one individual.

Parameters
individualThe individual to be mutated.

◆ Perform()

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

Attempts to mutate the entire population. The number of mutated individuals is based on mutation phase rate and mutate individual rate.

Parameters
constInputPopulationThe population containing individuals that are candidates for the mutation. This population should not be changed. Instead add the results to PopulationAfter.

Property Documentation

◆ MutateBothParentsAndChildren

bool Grail.Evolution.Mutation.MutateBothParentsAndChildren = 0.5
getset

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

◆ MutationGeneRate

double Grail.Evolution.Mutation.MutationGeneRate = 0.09
getset

IF randomResolutionTypeForGene == ITERATE_AND_TEST_P: the probability that a gene of an individual will be considered for mutation;
IF randomResolutionTypeForGene == SELECT_P_OF_N: the portion of genes within an individual chosen for mutation.

◆ MutationIndividualRate

double Grail.Evolution.Mutation.MutationIndividualRate = 1.0
getset

IF RandomResolutionTypeForIndividual == ITERATE_AND_TEST_P: the probability that an individual will be considered for mutation (RandomResolutionTypeForIndividual == ITERATE_AND_TEST_P);
IF RandomResolutionTypeForIndividual == SELECT_P_OF_N: the portion of individuals chosen for mutation (RandomResolutionTypeForIndividual == SELECT_P_OF_N).

◆ MutationPhaseRate

double Grail.Evolution.Mutation.MutationPhaseRate = MutationSelectionType.SELECT_P_OF_N
getset

The probability that mutation happens (globally). If a mutation is included in the algorithm, this value should most likely be equal to 1.0.

◆ RandomResolutionTypeForGene

MutationSelectionType Grail.Evolution.Mutation.RandomResolutionTypeForGene = MutationSelectionType.SELECT_P_OF_N
getset

Specifies how genes in an individual (already chosen for mutation) are chosen for mutation. See MutationSelectionType.

◆ RandomResolutionTypeForIndividual

MutationSelectionType Grail.Evolution.Mutation.RandomResolutionTypeForIndividual
getset

Specifies how individuals for mutations are chosen. See MutationSelectionType.


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