The Mutation structure that encapsulates the mutation operation and its configuration in evolutionary algorithm.
More...
#include <Mutation.hh>
|
| 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{}()) |
| Mutation - Constructor. More...
|
|
virtual void | Perform (const std::vector< std::unique_ptr< EvoScript >> &parentPopulation, const std::vector< std::unique_ptr< EvoScript >> &childrenPopulation) |
| Perform - Attempts to mutate the entire population. The umber of individuals mutates is based on mutation phase rate and mutate individual rate. More...
|
|
|
std::vector< std::unique_ptr< EvoScript > > | populationAfter {} |
|
double | 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.
|
|
double | 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).
|
|
double | 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).
|
|
bool | MutateBothParentsAndChildren = false |
| If true: both the previous population and children can be mutated; if false: only the individuals after crossover can be mutated.
|
|
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 -
|
SELECT_P_OF_N | SELECT_P_OF_N -
|
◆ Mutation()
grail::evolution::Mutation::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{}() |
|
) |
| |
Mutation - Constructor.
- Parameters
-
mutationPhaseRate | - 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 | -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). |
mutateChromosomeRate | - 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). |
mutateBothParentsAndChildren | - if true: both the previous population and children can be mutated; if false: only the individuals after crossover can be mutated. |
seed | - initial seed for random numbers generator. |
◆ Perform()
void grail::evolution::Mutation::Perform |
( |
const std::vector< std::unique_ptr< EvoScript >> & |
parentPopulation, |
|
|
const std::vector< std::unique_ptr< EvoScript >> & |
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: