Function PGASetMutationBounceBackFlag

Function Documentation

void PGASetMutationBounceBackFlag(PGAContext *ctx, int val)

If this flag is set to true, then for Integer and Real strings whenever a gene is mutated, if it underflows (overflows) the lower (upper) bound it is reset to a random value between the old value and the violated bound.

Description

When this flag is set, all allele values remain within the range the strings were initialized on by bouncing values that violate the bound back from the boundary. If this flag is PGA_FALSE (the default), the alleles may take any values. See also PGASetMutationBoundedFlag().

Example

PGAContext *ctx;

...
PGASetMutationBounceBackFlag (ctx, PGA_TRUE);

Parameters:
  • ctx – context variable

  • val – either PGA_TRUE or PGA_FALSE

Returns:

None