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

#include <RankSelection.h>

Inheritance diagram for RankSelection:
Inheritance graph
Collaboration diagram for RankSelection:
Collaboration graph

Public Member Functions

 RankSelection (const Algorithm_Parameters &params)
 Constructs a RankSelection 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 selected.
 
void setParents (Individual &offspring, const Individual &parent1, const Individual &parent2)
 Sets the parents and offspring for the selection operation.
 
void apply (std::mt19937 &generator) override
 Performs the rank-based 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

◆ RankSelection()

RankSelection::RankSelection ( const Algorithm_Parameters & params)

Constructs a RankSelection object with specified algorithm parameters.

Parameters
paramsThe algorithm parameters including the population size.

Member Function Documentation

◆ apply()

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

Performs the rank-based selection operation.

This method selects individuals from the population based on their rank 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 RankSelection::setIndividual ( Individual & individual)
inlinevirtual

Sets the individual to be selected.

This method sets the individual to be selected from the population.

Parameters
individualThe individual to be selected.

Implements Operator.

◆ setParents()

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

Sets the parents and offspring for the selection operation.

This method is not used by the RankSelection operator.

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

Implements Operator.

◆ setPopulation()

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

Pointer to the vector of individuals in the population

◆ populationSize

int RankSelection::populationSize
private

Size of the population

◆ selected

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

Pointer to the vector of selected individuals


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