Function PGASelectTournamentWithoutReplacement

Function Documentation

static int PGASelectTournamentWithoutReplacement(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. The selection happens without replacement. This means if we select N individuals with a tournament size of 2, each individual is participating in exactly two tournaments. This does not mean that a single individual cannot be returned more than once. For implementation notes on the algorithm see [GKD89], p. 504.

Example

PGAContext *ctx,
int l;

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

Parameters
  • ctx – context variable

  • pop – symbolic constant of population to select from

Returns

index of the selected string