Grail (C++)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
grail::evolution::Selection Class Reference

The Selection class encapsulates the selection operation, i.e., how individuals are selected from the current population to the next generation, in evolutionary algorithm.
See also EAOptimizer. More...

#include <Selection.hh>

Public Member Functions

virtual void Perform (std::vector< std::unique_ptr< Individual >> &currentPopulation, size_t populationMaxSize)
 Perform - performs the selection. More...
 

Detailed Description

The Selection class encapsulates the selection operation, i.e., how individuals are selected from the current population to the next generation, in evolutionary algorithm.
See also EAOptimizer.

Member Function Documentation

◆ Perform()

void grail::evolution::Selection::Perform ( std::vector< std::unique_ptr< Individual >> &  currentPopulation,
size_t  populationMaxSize 
)
virtual

Perform - performs the selection.

Parameters
currentPopulation- the input population before the selection. For convenience, it will be sorted by fitness.
Remove individuals from it until you reduce the size to populationMaxSize.
populationMaxSize- what is the maximum size of the population after the selection.

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