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
, andPGA_CROSSOVER_EDGE
for one-point, two-point, uniform, simulated binary (SBX), and edge crossover, respectively. The default isPGA_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