Function PGAIntegerSBXCrossover

Function Documentation

void PGAIntegerSBXCrossover(PGAContext *ctx, int p1, int p2, int pop1, int c1, int c2, int pop2)

Performs simulated binary crossover (SBX) on two parent strings producing two children via side-effect.

Description

Note that this function is set in PGASetUp() as the crossover user function for the integer datatype when selecting simulated binary crossover.

Example

Performs crossover on the two parent strings m and d, producing children s and b.

PGAContext *ctx;
int m, d, s, b;

...
PGAIntegerSBXCrossover (ctx, m, d, PGA_OLDPOP, s, b, PGA_NEWPOP);

Parameters
  • ctx – context variable

  • p1 – the first parent string

  • p2 – the second parent string

  • pop1 – symbolic constant of the population containing string p1 and p2

  • c1 – the first child string

  • c2 – the second child string

  • pop2 – symbolic constant of the population to contain string c1 and c2

Returns

c1 and c2 in population pop2 are modified by side-effect.