GERARDIUM RUSH - MINERAL CIRCUIT OPTIMIZER v1.0.0
"A powerful tool designed to optimize circuit configurations using advanced genetic algorithms." - by Pentlandite
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
GenProgMutation Class Reference

#include <GenProgMutation.h>

Inheritance diagram for GenProgMutation:
Inheritance graph
Collaboration diagram for GenProgMutation:
Collaboration graph

Public Member Functions

 GenProgMutation (int vectorSize, const Algorithm_Parameters &params)
 Constructs a GenProgMutation object with specified vector size and algorithm parameters.
 
void setIndividual (Individual &individual) override
 Sets the individual to be mutated.
 
void setPopulation (const std::vector< Individual > &population, std::vector< Individual > &selected)
 Sets the population and selected vectors for the mutation operation.
 
void setParents (Individual &offspring, const Individual &parent1, const Individual &parent2)
 Sets the parents and offspring for the mutation operation.
 
void apply (std::mt19937 &generator)
 Performs the mutation operation on the individual.
 
- Public Member Functions inherited from Operator
virtual ~Operator ()=default
 Virtual destructor for the Operator class.
 

Private Attributes

Individualindividual
 
int numUnits
 
double mutationRate
 

Constructor & Destructor Documentation

◆ GenProgMutation()

GenProgMutation::GenProgMutation ( int vectorSize,
const Algorithm_Parameters & params )

Constructs a GenProgMutation object with specified vector size and algorithm parameters.

Parameters
vectorSizeThe size of the vector representing the individual's genetic material.
paramsThe algorithm parameters including the mutation rate.

Member Function Documentation

◆ 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
generatorThe 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
individualThe individual to be mutated.

Implements Operator.

◆ setParents()

void GenProgMutation::setParents ( Individual & offspring,
const Individual & parent1,
const Individual & parent2 )
inlinevirtual

Sets the parents and offspring for the mutation operation.

This method is not used in the mutation operation.

Parameters
offspringThe offspring individual to be generated.
parent1The first parent individual.
parent2The 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
populationThe vector of individuals in the population.
selectedThe vector of selected individuals.

Implements Operator.

Field Documentation

◆ individual

Individual* GenProgMutation::individual
private

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: