Function PGASelect
Defined in File select.c
Function Documentation
-
void PGASelect(PGAContext *ctx, int popix)
Perform genetic algorithm selection using the defined selection scheme.
Description
The selection scheme used is either the default selection scheme or that specified with
PGASetSelectType()
.Valid selection methods are proportional, stochastic universal, tournament, probabilistic tournament selection, truncation selection, or linear selection with macros
PGA_SELECT_PROPORTIONAL
,PGA_SELECT_SUS
,PGA_SELECT_TOURNAMENT
,PGA_SELECT_PTOURNAMENT
,PGA_SELECT_TRUNCATION
,PGA_SELECT_LINEAR
respectively. This function updates an internal array with the indices of members ofpopix
selected for recombination. These indices may be accessed withPGASelectNextIndex()
. See Constants for Selection Types for the constants and section Selection in the user guide for details.Example
PGAContext *ctx, ... PGASelect (ctx, PGA_OLDPOP);
- Parameters:
ctx – context variable
popix – symbolic constant of population to select from
- Returns:
An array used by PGASelectNextIndex is created which contains the population indices of the selected individuals