Genex v1.0.1-beta Genex.Tools.Mutation View Source

Implementation of several population mutation methods.

Mutation takes place according to some rate. Mutation is useful for introducing novelty into the population. This ensures your solutions don't prematurely converge.

Future versions of Genex will provide the ability to define the "aggressiveness" of mutations. As of this version of Genex, mutations effect the ENTIRE chromosome.

Link to this section Summary

Functions

Perform a bit-flip mutation.

Perform a bit-flip mutation.

Performs creep mutation.

Performs creep mutation with at random genes.

Performs a gaussian mutation.

Performs a gaussian mutation at random genes.

Perform a scramble mutation.

Perform a scramble mutation on a random slice of size n.

Link to this section Functions

Perform a bit-flip mutation.

This mutation performs a binary XOR on every gene in the Chromosome.

Returns Chromosome.

Parameters

  • chromosome: Chromosome to mutate.

Perform a bit-flip mutation.

This mutation performs a binary XOR on a gene with probability p in the Chromosome.

Returns Chromosome.

Parameters

  • chromosome: Chromosome to mutate.
  • p: Probability of bitflip.

Performs creep mutation.

This mutation generates a random number between min and max at every gene in the chromosome.

Returns Chromosome.

Parameters

  • chromosome: Chromosome to mutate.
  • min: lower bound
  • max: upper bound
Link to this function

creep(chromosome, p, min, max)

View Source

Performs creep mutation with at random genes.

This mutation generates a random number between min and max at genes with probability p in the chromosome.

Returns Chromosome.

Parameters

  • chromosome: Chromosome to mutate.
  • p: Probability of mutation.
  • min: lower bound
  • max: upper bound

Performs a gaussian mutation.

This mutation generates a random number at every gene in the chromosome. The random number is from a normal distribution produced from the mean and variance of the genes in the chromosome.

Returns Chromosome.

Parameters

  • chromosome: Chromosome to mutate.

Performs a gaussian mutation at random genes.

This mutation generates a random number at random genes with probability p in the chromosome. The random number is from a normal distribution produced from the mean and variance of the genes in the chromosome.

Returns Chromosome.

Parameters

  • chromosome: Chromosome to mutate.
  • p: Probability of mutation.

Perform a scramble mutation.

This mutation scrambles the genes of the Chromosome.

Returns %Chromosome{}.

Parameters

  • chromosome: Chromosome to mutate.

Perform a scramble mutation on a random slice of size n.

This mutation scrambles the genes of the Chromosome between two random points.

Returns %Chromosome{}.

Parameters

  • chromosome: Chromosome to mutate.