Brush C++ API
A flexible interpretable machine learning framework
|
The SelectionOperator class represents a base class for selection operators in a genetic algorithm. More...
#include <selection_operator.h>
Public Member Functions | |
virtual | ~SelectionOperator () |
Destructor for the SelectionOperator class. | |
virtual vector< size_t > | select (Population< T > &pop, int island, const Parameters &p) |
Selects individuals from the population based on the selection operator's strategy. | |
virtual vector< size_t > | survive (Population< T > &pop, int island, const Parameters &p) |
Applies the selection operator to determine which individuals survive in the population. | |
Public Attributes | |
bool | survival |
string | name |
The SelectionOperator class represents a base class for selection operators in a genetic algorithm.
base class for selection operators.
This class provides common functionality and interface for selection operators.
Definition at line 28 of file selection_operator.h.
|
virtual |
Destructor for the SelectionOperator class.
Definition at line 10 of file selection_operator.cpp.
|
virtual |
Selects individuals from the population based on the selection operator's strategy.
pop | The population from which to select individuals. |
island | The index of the island in a parallel genetic algorithm. |
p | The parameters for the selection operator. |
Reimplemented in Brush::Sel::Lexicase< T >, and Brush::Sel::NSGA2< T >.
Definition at line 13 of file selection_operator.cpp.
|
virtual |
Applies the selection operator to determine which individuals survive in the population.
pop | The population in which to apply the survival selection. |
island | The index of the island in a parallel genetic algorithm. |
p | The parameters for the selection operator. |
Reimplemented in Brush::Sel::Lexicase< T >, and Brush::Sel::NSGA2< T >.
Definition at line 21 of file selection_operator.cpp.
string Brush::Sel::SelectionOperator< T >::name |
The name of the selection operator.
Definition at line 32 of file selection_operator.h.
bool Brush::Sel::SelectionOperator< T >::survival |
Flag indicating whether the selection operator is used for survival selection.
Definition at line 31 of file selection_operator.h.