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

#include <RouletteWheelSelection.h>

Inheritance diagram for RouletteWheelSelection:
Inheritance graph
Collaboration diagram for RouletteWheelSelection:
Collaboration graph

Public Member Functions

 RouletteWheelSelection (const Algorithm_Parameters &params)
 Constructs a RouletteWheelSelection object with specified algorithm parameters.
 
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 to be mutated.
 
void setParents (Individual &offspring, const Individual &parent1, const Individual &parent2)
 Sets the parents and offspring for the crossover operation.
 
void apply (std::mt19937 &generator) override
 Performs the roulette wheel selection operation.
 
- Public Member Functions inherited from Operator
virtual ~Operator ()=default
 Virtual destructor for the Operator class.
 

Private Attributes

std::vector< Individual > * selected
 
const std::vector< Individual > * population
 
int populationSize
 

Constructor & Destructor Documentation

◆ RouletteWheelSelection()

RouletteWheelSelection::RouletteWheelSelection ( const Algorithm_Parameters & params)

Constructs a RouletteWheelSelection object with specified algorithm parameters.

Parameters
paramsThe algorithm parameters.

Member Function Documentation

◆ apply()

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

Performs the roulette wheel selection operation.

This method selects individuals from the population based on fitness-proportional selection and stores the selected individuals in the provided vector.

Parameters
generatorThe random number generator used for selection.

Implements Operator.

Here is the caller graph for this function:

◆ setIndividual()

void RouletteWheelSelection::setIndividual ( Individual & individual)
inlinevirtual

Sets the individual to be mutated.

Parameters
individualThe individual to be mutated.
individualThe individual to be mutated.

Implements Operator.

◆ setParents()

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

Sets the parents and offspring for the crossover operation.

This method is not used by the RouletteWheelSelection operator.

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

Implements Operator.

◆ setPopulation()

void RouletteWheelSelection::setPopulation ( const std::vector< Individual > & population,
std::vector< Individual > & selected )
virtual

Sets the population and selected vectors for the selection operation.

Parameters
populationThe vector of individuals in the population.
selectedThe vector of selected individuals.

Implements Operator.

Here is the caller graph for this function:

Field Documentation

◆ population

const std::vector<Individual>* RouletteWheelSelection::population
private

Pointer to the vector of individuals in the population

◆ populationSize

int RouletteWheelSelection::populationSize
private

Size of the population

◆ selected

std::vector<Individual>* RouletteWheelSelection::selected
private

Pointer to the vector of selected individuals


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