GERARDIUM RUSH - MINERAL CIRCUIT OPTIMIZER v1.0.0
"A powerful tool designed to optimize circuit configurations using advanced genetic algorithms." - by Pentlandite
|
Abstract base class for genetic algorithm operators. More...
#include <Operator.h>
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. | |
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.
|
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.
|
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.
|
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.
individual | The individual to operate on. |
Implemented in PureSinglePointCrossover, TwoPointCrossover, UniformCrossover, NaryTournamentSelection, RankSelection, RouletteWheelSelection, GenProgMutation, and GuidedMutation.
|
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.
parent1 | The first parent individual. |
parent2 | The second parent individual. |
Implemented in GenProgMutation, GuidedMutation, NaryTournamentSelection, RankSelection, RouletteWheelSelection, PureSinglePointCrossover, TwoPointCrossover, and UniformCrossover.
|
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.
population | The population of individuals to operate on. |
selected | The selected individuals to store the results of the operation. |
Implemented in PureSinglePointCrossover, TwoPointCrossover, UniformCrossover, GenProgMutation, GuidedMutation, RouletteWheelSelection, NaryTournamentSelection, and RankSelection.