java.lang.Object
org.moeaframework.core.operator.TypeSafeMutation<Subset>
org.moeaframework.core.operator.subset.Replace
All Implemented Interfaces:
Configurable, Mutation, Variation

public class Replace extends TypeSafeMutation<Subset>
Replacement mutation operator. Randomly replaces one of the members in the subset with a non-member.

This operator is type-safe.

  • Constructor Details

    • Replace

      public Replace()
      Constructs a replacement mutation operator with default settings.
    • Replace

      public Replace(double probability)
      Constructs a replacement mutation operator with the specified probability of mutating a variable.
      Parameters:
      probability - the probability of mutating a variable
  • 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.
      Returns:
      the name of this variation operator
    • mutate

      public void mutate(Subset subset)
      Mutates the specified subset using the replacement mutation operator.
      Specified by:
      mutate in class TypeSafeMutation<Subset>
      Parameters:
      subset - the subset to be mutated