Function PGASetPopReplaceType

Function Documentation

void PGASetPopReplaceType(PGAContext *ctx, int pop_replace)

Choose method of replacing strings in the new population.

Description

Valid choices are PGA_POPREPL_BEST, PGA_POPREPL_RANDOM_NOREP, or PGA_POPREPL_RANDOM_REP for copying the best strings, or random string, with or without replacement, respectively, from the old population into the new population. Additional replacement types are PGA_POPREPL_RTR for restricted tournament replacement, PGA_POPREPL_PAIRWISE_BEST for pairwise comparison of each individual in the old/new population, and PGA_POPREPL_NSGA_II and PGA_POPREPL_NSGA_III for multiobjective optimization using the Nondominated Sorting Genetic Algorithm (NSGA-II or NSGA-III). The default is PGA_POPREPL_BEST. See Constants for Population Replacement Strategies for the constants and section Population Replacement in the user guide for details.

Example

PGAContext *ctx;

...
PGASetPopReplaceType (ctx, PGA_POPREPL_RANDOM_NOREP);

Parameters
  • ctx – context variable

  • pop_replace – symbolic constant to specify the population replacement strategy

Returns

None