Function PGACrossoverSBX

Function Documentation

void PGACrossoverSBX(PGAContext *ctx, double p1, double p2, double u, double *c1, double *c2)

Cross over two parent alleles with simulated binary crossover (SBX).

Description

This uses double for both parent alleles but is re-used in both, integer and real SBX crossover in PGAIntegerSBXCrossover() and PGARealSBXCrossover(), respectively. The probability is used to compute the new alleles from the polynomial distribution.

Example

PGAContext *ctx;
double p1, p2, u;
double c1, c2;
double result;

...
u = PGARandom01 (ctx, 0);
result = PGACrossoverSBX (ctx, p1, p2, u, &c1, &c2);

Parameters
  • ctx – context variable

  • p1 – (double) Allele of first string

  • p2 – (double) Allele of second string

  • u – Random value between 0 and 1

  • c1 – pointer to new first child allele

  • c2 – pointer to new second child allele

Returns

None