Function PGASelectTournament

Function Documentation

static int PGASelectTournament(PGAContext *ctx, int pop)

Choose N strings randomly and return the one with best evaluation.

Description

The configuration parameter N is the value set with PGASetTournamentSize(), the default is 2. Depending on the setting of PGASetTournamentWithReplacement() calls one of two local functions to use the right sampling.

Example

PGAContext *ctx,
int l;

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

Parameters:
  • ctx – context variable

  • pop – symbolic constant of population to select from

Returns:

index of the selected string