#include <GenProgMutation.h>
◆ GenProgMutation()
Constructs a GenProgMutation object with specified vector size and algorithm parameters.
- Parameters
-
vectorSize | The size of the vector representing the individual's genetic material. |
params | The algorithm parameters including the mutation rate. |
◆ apply()
void GenProgMutation::apply |
( |
std::mt19937 & | generator | ) |
|
|
virtual |
Performs the mutation operation on the individual.
This method performs mutation on the individual's genetic material based on the specified mutation rate. The mutation modifies the genes of the individual to introduce variations.
- Parameters
-
generator | The random number generator used to determine if mutation should occur. |
Implements Operator.
◆ setIndividual()
void GenProgMutation::setIndividual |
( |
Individual & | individual | ) |
|
|
overridevirtual |
Sets the individual to be mutated.
- Parameters
-
individual | The individual to be mutated. |
Implements Operator.
◆ setParents()
Sets the parents and offspring for the mutation operation.
This method is not used in the mutation operation.
- Parameters
-
offspring | The offspring individual to be generated. |
parent1 | The first parent individual. |
parent2 | The second parent individual. |
Implements Operator.
◆ setPopulation()
void GenProgMutation::setPopulation |
( |
const std::vector< Individual > & | population, |
|
|
std::vector< Individual > & | selected ) |
|
inlinevirtual |
Sets the population and selected vectors for the mutation operation.
This method is not used in the mutation operation.
- Parameters
-
population | The vector of individuals in the population. |
selected | The vector of selected individuals. |
Implements Operator.
◆ individual
Pointer to the individual to be mutated
◆ mutationRate
double GenProgMutation::mutationRate |
|
private |
The mutation rate used to determine if mutation should occur
◆ numUnits
int GenProgMutation::numUnits |
|
private |
Represents the number of units or types of operations/nodes
The documentation for this class was generated from the following files: