#include <GuidedMutation.h>
◆ GuidedMutation()
Constructs a GuidedMutation 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 GuidedMutation::apply |
( |
std::mt19937 & | generator | ) |
|
|
overridevirtual |
Performs the guided 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 according to specific rules or heuristics.
- Parameters
-
generator | The random number generator used to determine if mutation should occur. |
Implements Operator.
◆ setIndividual()
void GuidedMutation::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 crossover operation.
This method is not used by the GuidedMutation operator.
- Parameters
-
offspring | The offspring individual to be generated. |
parent1 | The first parent individual. |
parent2 | The second parent individual. |
Implements Operator.
◆ setPopulation()
void GuidedMutation::setPopulation |
( |
const std::vector< Individual > & | population, |
|
|
std::vector< Individual > & | selected ) |
|
inlinevirtual |
Performs the guided 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 according to specific rules or heuristics.
- Parameters
-
generator | The random number generator used to determine if mutation should occur. |
Implements Operator.
◆ individual
Pointer to the individual to be mutated
◆ mutationRate
double GuidedMutation::mutationRate |
|
private |
The mutation rate used to determine if mutation should occur
◆ numUnits
int GuidedMutation::numUnits |
|
private |
Represents the number of units or types of operations/nodes
The documentation for this class was generated from the following files: