Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
Brush::Sel::SelectionOperator< T > Class Template Reference

The SelectionOperator class represents a base class for selection operators in a genetic algorithm. More...

#include <selection_operator.h>

Inheritance diagram for Brush::Sel::SelectionOperator< T >:
Collaboration diagram for Brush::Sel::SelectionOperator< T >:

Public Member Functions

virtual ~SelectionOperator ()
 Destructor for the SelectionOperator class.
 
virtual vector< size_tselect (Population< T > &pop, int island, const Parameters &p)
 Selects individuals from the population based on the selection operator's strategy.
 
virtual vector< size_tsurvive (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
 

Detailed Description

template<ProgramType T>
class Brush::Sel::SelectionOperator< T >

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.

Constructor & Destructor Documentation

◆ ~SelectionOperator()

Destructor for the SelectionOperator class.

Definition at line 10 of file selection_operator.cpp.

Member Function Documentation

◆ select()

template<ProgramType T>
vector< size_t > Brush::Sel::SelectionOperator< T >::select ( Population< T > & pop,
int island,
const Parameters & p )
virtual

Selects individuals from the population based on the selection operator's strategy.

Parameters
popThe population from which to select individuals.
islandThe index of the island in a parallel genetic algorithm.
pThe parameters for the selection operator.
Returns
A vector of indices representing the selected individuals.

Reimplemented in Brush::Sel::Lexicase< T >, and Brush::Sel::NSGA2< T >.

Definition at line 13 of file selection_operator.cpp.

◆ survive()

template<ProgramType T>
vector< size_t > Brush::Sel::SelectionOperator< T >::survive ( Population< T > & pop,
int island,
const Parameters & p )
virtual

Applies the selection operator to determine which individuals survive in the population.

Parameters
popThe population in which to apply the survival selection.
islandThe index of the island in a parallel genetic algorithm.
pThe parameters for the selection operator.
Returns
A vector of indices representing the surviving individuals.

Reimplemented in Brush::Sel::Lexicase< T >, and Brush::Sel::NSGA2< T >.

Definition at line 21 of file selection_operator.cpp.

Member Data Documentation

◆ name

template<ProgramType T>
string Brush::Sel::SelectionOperator< T >::name

The name of the selection operator.

Definition at line 32 of file selection_operator.h.

◆ survival

template<ProgramType T>
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.


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