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
PureSinglePointCrossover Class Reference

#include <PureSinglePointCrossover.h>

Inheritance diagram for PureSinglePointCrossover:
Inheritance graph
Collaboration diagram for PureSinglePointCrossover:
Collaboration graph

Public Member Functions

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

Private Attributes

Individualoffspring
 
const Individualparent1
 
const Individualparent2
 
double crossoverRate
 

Constructor & Destructor Documentation

◆ PureSinglePointCrossover()

PureSinglePointCrossover::PureSinglePointCrossover ( const Algorithm_Parameters & params)

Constructs a PureSinglePointCrossover object with specified algorithm parameters.

Parameters
paramsThe algorithm parameters including the crossover rate.

Member Function Documentation

◆ apply()

void PureSinglePointCrossover::apply ( std::mt19937 & generator)
overridevirtual

Performs the single-point crossover operation.

This method performs a single-point crossover on the two parent individuals to generate an offspring individual. The crossover point is chosen randomly, and the genetic material from the two parents is combined to create the offspring.

Parameters
generatorThe random number generator used to determine the crossover point.

Implements Operator.

◆ setIndividual()

void PureSinglePointCrossover::setIndividual ( Individual & individual)
inlinevirtual

Sets the individual for the selection operation.

This method is not used in the PureSinglePointCrossover class.

Parameters
individual

Implements Operator.

◆ setParents()

void PureSinglePointCrossover::setParents ( Individual & offspring,
const Individual & parent1,
const Individual & parent2 )
overridevirtual

Sets the parents and offspring for the crossover operation.

Parameters
offspringThe offspring individual to be generated.
parent1The first parent individual.
parent2The second parent individual.

Implements Operator.

◆ setPopulation()

void PureSinglePointCrossover::setPopulation ( const std::vector< Individual > & population,
std::vector< Individual > & selected )
inlinevirtual

Sets the population and selected vectors for the selection operation.

This method is not used in the PureSinglePointCrossover class.

Parameters
population
selected

Implements Operator.

Field Documentation

◆ crossoverRate

double PureSinglePointCrossover::crossoverRate
private

The crossover rate used to determine if crossover should occur

◆ offspring

Individual* PureSinglePointCrossover::offspring
private

Pointer to the offspring individual

◆ parent1

const Individual* PureSinglePointCrossover::parent1
private

Pointer to the first parent individual

◆ parent2

const Individual* PureSinglePointCrossover::parent2
private

Pointer to the second parent individual


The documentation for this class was generated from the following files: