Function PGASelectPTournament

Function Documentation

int PGASelectPTournament(PGAContext *ctx, int pop)

Choose two strings randomly and return the one with better evaluation with a specified probability.

Description

See description in Goldbergs classic book [Gol89], p. 121.

Example

PGAContext *ctx,
int l;

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

Parameters
  • ctx – context variable

  • pop – symbolic constant of population to select from

Returns

index of the selected string