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, and PGA_CROSSOVER_EDGE for one-point, two-point, uniform, simulated binary (SBX), and edge crossover, respectively. The default is PGA_CROSSOVER_TWOPT. Edge crossover is only defined for integer genes 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