Function PGASetCrossoverType
Defined in File cross.c
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, orPGA_CROSSOVER_UNIFORM,PGA_CROSSOVER_SBX,PGA_CROSSOVER_EDGE,PGA_CROSSOVER_PMX,PGA_CROSSOVER_MODIFIEDPGA_CROSSOVER_ORDER,PGA_CROSSOVER_CYCLE,PGA_CROSSOVER_OBX,PGA_CROSSOVER_PBX,PGA_CROSSOVER_UOX, :c:macro:`PGA_CROSSOVER_AEX, andPGA_CROSSOVER_NOXfor 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 isPGA_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