Function PGASetMutationType

Function Documentation

void PGASetMutationType(PGAContext *ctx, int mutation_type)

Set type of mutation to use.

Description

Only effects integer- and real-valued strings. Binary-valued strings are always complemented. In character-valued strings, one alphabetic character is replaced with another chosen uniformly randomly. The alphabetic characters will be lower, upper, or mixed case depending on how the strings were initialized.

Valid choices are PGA_MUTATION_CONSTANT (Real/Integer), PGA_MUTATION_RANGE (Real/Integer), PGA_MUTATION_UNIFORM (Real), PGA_MUTATION_GAUSSIAN (Real), PGA_MUTATION_PERMUTE (Integer), PGA_MUTATION_DE (Real), and PGA_MUTATION_POLY (Real/Integer). The default for integer-valued strings conforms to how the strings were initialized. The default for real-valued strings is PGA_MUTATION_GAUSSIAN. See Constants for Mutation Types for the constants and section Mutation in the user guide for more details.

Example

PGAContext *ctx;

...
PGASetMutationType (ctx, PGA_MUTATION_UNIFORM);

Parameters
  • ctx – context variable

  • mutation_type – symbolic constant to specify the mutation type

Returns

None