GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Public Member Functions | List of all members
galib::LocalSelection< GeneType > Class Template Referenceabstract

Abstract interface for neighbourhood-based parent selection in a cellular GA. More...

#include <LocalSelection.h>

Inheritance diagram for galib::LocalSelection< GeneType >:
[legend]

Public Member Functions

virtual ~LocalSelection ()=default
 Virtual destructor for polymorphic use.
 
virtual const Individual< GeneType > & select (const Population< GeneType > &population, std::size_t row, std::size_t col, std::size_t rows, std::size_t cols) const =0
 Selects one individual from the neighbourhood of a grid cell.
 

Detailed Description

template<typename GeneType>
class galib::LocalSelection< GeneType >

Abstract interface for neighbourhood-based parent selection in a cellular GA.

Implementations choose one individual for the current cell using only the local neighbourhood of that cell in the inferred 2D grid.

Template Parameters
GeneTypeNumeric type of each gene.

Definition at line 19 of file LocalSelection.h.

Constructor & Destructor Documentation

◆ ~LocalSelection()

template<typename GeneType >
virtual galib::LocalSelection< GeneType >::~LocalSelection ( )
virtualdefault

Virtual destructor for polymorphic use.

Member Function Documentation

◆ select()

template<typename GeneType >
virtual const Individual< GeneType > & galib::LocalSelection< GeneType >::select ( const Population< GeneType > &  population,
std::size_t  row,
std::size_t  col,
std::size_t  rows,
std::size_t  cols 
) const
pure virtual

Selects one individual from the neighbourhood of a grid cell.

Parameters
populationPopulation interpreted as a 2D grid in row-major order.
rowRow of the current cell.
colColumn of the current cell.
rowsTotal number of grid rows.
colsTotal number of grid columns.
Returns
Const reference to the selected neighbouring individual.
Note
Lower fitness values are considered better.

Implemented in galib::BestNeighborSelection< GeneType >.


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