org.apache.commons.math3.genetics

## Class BinaryMutation

- java.lang.Object
- - org.apache.commons.math3.genetics.BinaryMutation

- All Implemented Interfaces:
    MutationPolicy

      public class BinaryMutation
      extends Object
      implements MutationPolicy

  Mutation for `BinaryChromosome`s. Randomly changes one gene.
  Since:
    2.0
  Version:
    $Id: BinaryMutation.java 1244107 2012-02-14 16:17:55Z erans $

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BinaryMutation()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Chromosome` | `mutate(Chromosome original)` Mutate the given chromosome.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BinaryMutation

          public BinaryMutation()

  - ### Method Detail

    - #### mutate

          public Chromosome mutate(Chromosome original)

      Mutate the given chromosome. Randomly changes one gene.
      Specified by:
        `mutate` in interface `MutationPolicy`
      Parameters:
        `original` - the original chromosome.
      Returns:
        the mutated chromosome.
      Throws:
        `MathIllegalArgumentException` - if `original` is not an instance of `BinaryChromosome`.

Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.