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
Operator Class Referenceabstract

Abstract base class for genetic algorithm operators. More...

#include <Operator.h>

Inheritance diagram for Operator:
Inheritance graph
Collaboration diagram for Operator:
Collaboration graph

Public Member Functions

virtual ~Operator ()=default
 Virtual destructor for the Operator class.
 
virtual void apply (std::mt19937 &generator)=0
 Pure virtual function to apply the operator.
 
virtual void setPopulation (const std::vector< Individual > &population, std::vector< Individual > &selected)=0
 Sets the population and selected individuals for the operator.
 
virtual void setIndividual (Individual &individual)=0
 Sets the individual for the operator.
 
virtual void setParents (Individual &offspring, const Individual &parent1, const Individual &parent2)=0
 Sets the parents for the operator.
 

Detailed Description

Abstract base class for genetic algorithm operators.

The Operator class provides an abstract interface for genetic algorithm operators. It defines a pure virtual function apply(), which must be implemented by derived classes. This class serves as a base for various types of genetic algorithm operators, such as selection, crossover, and mutation.

Constructor & Destructor Documentation

◆ ~Operator()

virtual Operator::~Operator ( )
virtualdefault

Virtual destructor for the Operator class.

The virtual destructor ensures that derived class destructors are called correctly when an object is deleted through a base class pointer.

Member Function Documentation

◆ apply()

virtual void Operator::apply ( std::mt19937 & generator)
pure virtual

Pure virtual function to apply the operator.

This function must be implemented by derived classes to perform the specific operation of the genetic algorithm operator.

Implemented in GenProgMutation, PureSinglePointCrossover, TwoPointCrossover, UniformCrossover, GuidedMutation, NaryTournamentSelection, RankSelection, and RouletteWheelSelection.

◆ setIndividual()

virtual void Operator::setIndividual ( Individual & individual)
pure virtual

Sets the individual for the operator.

This function sets the individual for the operator. It is used to provide the operator with the necessary data to perform its operation on a single individual.

Parameters
individualThe individual to operate on.

Implemented in PureSinglePointCrossover, TwoPointCrossover, UniformCrossover, NaryTournamentSelection, RankSelection, RouletteWheelSelection, GenProgMutation, and GuidedMutation.

◆ setParents()

virtual void Operator::setParents ( Individual & offspring,
const Individual & parent1,
const Individual & parent2 )
pure virtual

Sets the parents for the operator.

This function sets the parents for the operator. It is used to provide the operator with the necessary data to perform its operation on two parent individuals.

Parameters
parent1The first parent individual.
parent2The second parent individual.

Implemented in GenProgMutation, GuidedMutation, NaryTournamentSelection, RankSelection, RouletteWheelSelection, PureSinglePointCrossover, TwoPointCrossover, and UniformCrossover.

◆ setPopulation()

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

Sets the population and selected individuals for the operator.

This function sets the population and selected individuals for the operator. It is used to provide the operator with the necessary data to perform its operation.

Parameters
populationThe population of individuals to operate on.
selectedThe selected individuals to store the results of the operation.

Implemented in PureSinglePointCrossover, TwoPointCrossover, UniformCrossover, GenProgMutation, GuidedMutation, RouletteWheelSelection, NaryTournamentSelection, and RankSelection.


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