Mutation Operators

mut_gaussian(individual, mu, sigma, mut_prob)

Applies a gaussian mutation of mean mu and standard deviation sigma on the input individual.

Parameters
  • individual (Individual) – The individual to be mutated.

  • mu (NumOrSeq) – The mean value of the gaussian mutation.

  • sigma (NumOrSeq) – The standard deviation of the gaussian mutation.

  • mut_prob (float) – The probability of mutating each attribute.

Returns

A mutated individual.

Return type

Mutant

mut_polynomial_bounded(individual, eta, low, up, mut_prob)

Applies a polynomial mutation with a crowding degree of eta on the input individual.

Parameters
  • individual (Individual) – The individual to be mutated.

  • eta (float) – The crowding degree of the crossover. Higher values produce children more similar to their parents, while smaller values produce children more divergent from their parents.

  • low (NumOrSeq) – The lower bound of the search space.

  • up (NumOrSeq) – The upper bound of the search space.

  • mut_prob (float) – The probability of mutating each attribute.

Returns

A mutated individual.

Return type

Mutant

mut_shuffle_indexes(individual, mut_prob)

Shuffles the attributes of the input individual.

Parameters
  • individual (Individual) – The individual to be mutated.

  • mut_prob (float) – The probability of mutating each attribute.

Returns

A mutated individual.

Return type

Mutant

mut_flip_bit(individual, mut_prob)

Flips the values of random attributes of the input individual.

Parameters
  • individual (Individual) – The individual to be mutated.

  • mut_prob (float) – The probability of mutating each attribute.

Returns

A mutated individual.

Return type

Mutant

mut_uniform_int(individual, low, up, mut_prob)
Mutates an individual by replacing attribute values with integers
chosen uniformly between the low and up, inclusively.
Parameters
  • individual (Individual) – The individual to be mutated.

  • low (int) – The lower bound of the search space.

  • up (int) – The upper bound of the search space.

  • mut_prob (float) – The probability of mutating each attribute.

Returns

A mutated individual.

Return type

Mutant

mut_es_log_normal(individual, learn_rate, mut_prob)

Mutates an evolution strategy according to its strategy attribute.

Parameters
  • individual (Individual) – The individual to be mutated.

  • learn_rate (float) – The learning rate of the evolution strategy. For an evolution strategy of (10, 100) the recommended value is 1.

  • mut_prob (float) – The probability of mutating each attribute.

Returns

A mutated individual.

Return type

Mutant