Class PointMutation

java.lang.Object
org.moeaframework.core.operator.program.PointMutation
All Implemented Interfaces:
Configurable, Mutation, Variation

public class PointMutation extends Object implements Mutation
Mutates a program by randomly selecting nodes in the expression tree and replacing the node with a new, compatible, randomly-selected node.

This operator is type-safe.

  • Constructor Details

    • PointMutation

      public PointMutation()
      Constructs a new point mutation operator with the default settings.
    • PointMutation

      public PointMutation(double probability)
      Constructs a new point mutation operator.
      Parameters:
      probability - the probability of mutating a node in the tree
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Variation
      Returns the name of this variation operator. This name should also be used as the prefix for any parameters. As such, the name should only contain alphanumeric characters, avoid using whitespace and other symbols.
      Specified by:
      getName in interface Variation
      Returns:
      the name of this variation operator
    • getProbability

      public double getProbability()
      Gets the probability of mutating a node in the tree.
      Returns:
      the probability
    • setProbability

      public void setProbability(double probability)
      Sets the probability of mutating a node in the tree.
      Parameters:
      probability - the probability (0.0 - 1.0)
    • mutate

      public Solution mutate(Solution parent)
      Description copied from interface: Mutation
      Mutates the given parent to produce an offspring.
      Specified by:
      mutate in interface Mutation
      Parameters:
      parent - the parent solution
      Returns:
      the offspring
    • mutate

      protected void mutate(Node node, Rules rules)
      Applies point mutation to the specified node.
      Parameters:
      node - the node undergoing point mutation
      rules - the rules defining the program syntax