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

#include <NaryTournamentSelection.h>

Inheritance diagram for NaryTournamentSelection:
Inheritance graph
Collaboration diagram for NaryTournamentSelection:
Collaboration graph

Public Member Functions

 NaryTournamentSelection (const Algorithm_Parameters &params)
 Constructs an NaryTournamentSelection object with specified algorithm parameters.
 
void setPopulation (const std::vector< Individual > &population, std::vector< Individual > &selected) override
 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 n-ary tournament 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 tournamentSize
 

Constructor & Destructor Documentation

◆ NaryTournamentSelection()

NaryTournamentSelection::NaryTournamentSelection ( const Algorithm_Parameters & params)

Constructs an NaryTournamentSelection object with specified algorithm parameters.

Parameters
paramsThe algorithm parameters including the tournament size.

Member Function Documentation

◆ apply()

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

Performs the n-ary tournament selection operation.

This method selects individuals from the population based on n-ary tournament competition and stores the selected individuals in the provided vector.

Parameters
generatorThe random number generator used for selecting individuals.

Implements Operator.

Here is the caller graph for this function:

◆ setIndividual()

void NaryTournamentSelection::setIndividual ( Individual & individual)
inlinevirtual

Sets the individual to be mutated.

This method sets the individual to be mutated by the operator.

Parameters
individualThe individual to be mutated.

Implements Operator.

◆ setParents()

void NaryTournamentSelection::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 NaryTournamentSelection operator.

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

Implements Operator.

◆ setPopulation()

void NaryTournamentSelection::setPopulation ( const std::vector< Individual > & population,
std::vector< Individual > & selected )
overridevirtual

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>* NaryTournamentSelection::population
private

Pointer to the vector of individuals in the population

◆ selected

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

Pointer to the vector of selected individuals

◆ tournamentSize

int NaryTournamentSelection::tournamentSize
private

Size of the tournament (number of individuals competing)


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