Function PGASetCrossoverType

Function Documentation

void PGASetCrossoverType(PGAContext *ctx, int crossover_type)

Specify the type of crossover to use.

Description

Valid choices are PGA_CROSSOVER_ONEPT, PGA_CROSSOVER_TWOPT, or PGA_CROSSOVER_UNIFORM, PGA_CROSSOVER_SBX, PGA_CROSSOVER_EDGE, PGA_CROSSOVER_PMX, PGA_CROSSOVER_MODIFIED PGA_CROSSOVER_ORDER, PGA_CROSSOVER_CYCLE, PGA_CROSSOVER_OBX, PGA_CROSSOVER_PBX, PGA_CROSSOVER_UOX, :c:macro:`PGA_CROSSOVER_AEX, and PGA_CROSSOVER_NOX for one-point, two-point, uniform, simulated binary (SBX), edge crossover, partially mapped crossover, modified crossover, order crossover, cycle crossover, order based crossover, position based crossover, uniform order based crossover, alternating edges crossover, and non-wrapping order crossover, respectively. The default is PGA_CROSSOVER_TWOPT. All crossover types starting with Edge crossover are only defined for integer genes (they act on genes which are a permutation) and SBX is only defined for integer and real genes. See Crossover Constants for the constants and section Crossover in the user guide for details.

Example

Use uniform crossover when crossingover strings.

PGAContext *ctx;

...
PGASetCrossoverType (ctx, PGA_CROSSOVER_UNIFORM);

Parameters:
  • ctx – context variable

  • crossover_type – symbolic constant to specify crossover type

Returns:

None