The Mutation structure that encapsulates the mutation operation and its configuration in evolutionary algorithm.
More...
#include <Mutation.hh>
|
double | MutationPhaseRate = 1.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.
|
|
double | MutateIndividualRate = 0.09 |
| Probability that an individual will be considered for mutation [if (randomResolutionTypeForIndividual == ITERATE_AND_TEST_P)]; or the portion of individuals chosen for mutation [if (randomResolutionTypeForIndividual == SELECT_P_OF_N)].
|
|
double | MutateGeneRate = 0.5 |
| Probability that a gene of an individual will be considered for mutation [if (randomResolutionTypeForGene == ITERATE_AND_TEST_P)]; or the portion of genes within an individual chosen for mutation [if (randomResolutionTypeForGene == SELECT_P_OF_N)].
|
|
bool | MutateBothParentsAndChildren = false |
| If true: both the previous population and children can be mutated; if false: only the individuals after crossover can be mutated.
|
|
MutationSelectionType | RandomResolutionTypeForIndividual = MutationSelectionType::SELECT_P_OF_N |
| Specifies how individuals for mutations are chosen. See MutationSelectionType enum.
|
|
MutationSelectionType | RandomResolutionTypeForGene = MutationSelectionType::SELECT_P_OF_N |
| Specifies how genes in an individual (already chosen for mutation) are chosen for mutation. See MutationSelectionType enum.
|
|
The Mutation structure that encapsulates the mutation operation and its configuration in evolutionary algorithm.
◆ MutationSelectionType
Predefined ways in which individuals are selected from the population for mutation. Please refer to enum values for details about each of them.
Enumerator |
---|
ITERATE_AND_TEST_P | ITERATE_AND_TEST_P - a random test whether to mutate an individual will be performed for each individual in a loop.
|
SELECT_P_OF_N | SELECT_P_OF_N - upfront, the PopulationSize*MutationIndividualRate of individuals will be randomly chosen for mutation. This ensures that the expected number of individuals will be mutated, regardless of RNG.
|
◆ Mutation()
Mutation - Constructor.
- Parameters
-
mutationPhaseRate | - the 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. |
mutateIndividualRate | - the probability that an individual will be considered for mutation [if (randomResolutionTypeForIndividual == ITERATE_AND_TEST_P)]; or represents the portion of individuals chosen for mutation [if (randomResolutionTypeForIndividual == SELECT_P_OF_N)]. |
mutateGeneRate | - the probability that a gene of an individual will be considered for mutation [if (randomResolutionTypeForGene == ITERATE_AND_TEST_P)]; or the portion of genes within an individual chosen for mutation [if (randomResolutionTypeForGene == SELECT_P_OF_N)]. |
mutateBothParentsAndChildren | - if true: both the previous population and children can be mutated; if false: only the individuals after crossover can be mutated. |
randomResolutionTypeForIndividual | - specifies how individuals for mutations are chosen. See MutationSelectionType enum. |
randomResolutionTypeForGene | - specifies how genes in an individual (already chosen for mutation) are chosen for mutation. See MutationSelectionType enum. |
seed | - the initial seed for random numbers generator. |
◆ MutateGene()
The function that performs the mutation operation of a single parameter within the mutated individual.
- Parameters
-
individual | - the individual to be mutated. |
gene | - the parameter of the individual to be mutated. |
◆ MutateIndividual()
void grail::evolution::Mutation::MutateIndividual |
( |
Individual & |
individual | ) |
|
|
protectedvirtual |
The function that performs the mutation operation of one individual.
- Parameters
-
individual | - the individual to be mutated. |
◆ Perform()
void grail::evolution::Mutation::Perform |
( |
const std::vector< std::unique_ptr< Individual >> & |
parentPopulation, |
|
|
const std::vector< std::unique_ptr< Individual >> & |
childrenPopulation |
|
) |
| |
|
virtual |
Perform - Attempts to mutate the entire population. The umber of individuals mutates is based on mutation phase rate and mutate individual rate.
- Parameters
-
parentPopulation | Parent population - before the mutation. |
childrenPopulation | Children population - after the mutation. |
The documentation for this struct was generated from the following files: