Function PGASelectProportional

Function Documentation

static int PGASelectProportional(PGAContext *ctx, PGAIndividual *pop)

Select a parent for the next generation using a linear search through a (fitness) weighted ‘roulette wheel’.

Description

The probability of selection of individual \(i\) with fitness \(f_i\) is given by Goldberg [Gol89], p. 11 as \(p_i = \frac{f_i}{\sum_{i} f_i}\)

Example

PGAContext *ctx,
int l;

...
l = PGASelectProportional (ctx, PGA_OLDPOP);

Parameters
  • ctx – context variable

  • pop – pointer to first individual of population

Returns

index of the selected string