geneticWedge.gp
Enum Mutation.MutationOperator

java.lang.Object
  extended by java.lang.Enum<Mutation.MutationOperator>
      extended by geneticWedge.gp.Mutation.MutationOperator
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Mutation.MutationOperator>
Enclosing class:
Mutation

public static enum Mutation.MutationOperator
extends java.lang.Enum<Mutation.MutationOperator>

Mutation operators should be chosen with care. Most of the operators are neutral with respect to program length, but SHRINK has a bias towards small programs and HOIST has a heavy bias towards small programs. EXPAND can have a large bias towards larger programs, if setMaximumExpandDepth() is called with a large value


Enum Constant Summary
CONSTANT
          CONSTANT changes the value of a Constant node by a random amount (generated with a Gaussian distribution).
EXPAND
          EXPAND replaces a randomly chosen Terminal with a randomly chosen subtree.
HOIST
          HOIST creates a new Individual from a randomly chosen subtree of the parent.
POINT_REPLACEMENT
          POINT_REPLCEMENT replaces a single component with a randomly generated component with the same arity
SHRINK
          SHRINK replaces a randomly chosen subtree with a randomly chosen Terminal.
SUBTREE_REPLACEMENT
          This is the 'standard' mutation operator.
SWAP
          SWAP chooses a non-commutative binary node (such as SUBTRACT) and swaps the subtrees below this node
 
Method Summary
static Mutation.MutationOperator valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Mutation.MutationOperator[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SUBTREE_REPLACEMENT

public static final Mutation.MutationOperator SUBTREE_REPLACEMENT
This is the 'standard' mutation operator. It replaces a subtree with a randomly generated subtree of similar size.


POINT_REPLACEMENT

public static final Mutation.MutationOperator POINT_REPLACEMENT
POINT_REPLCEMENT replaces a single component with a randomly generated component with the same arity


HOIST

public static final Mutation.MutationOperator HOIST
HOIST creates a new Individual from a randomly chosen subtree of the parent.


SHRINK

public static final Mutation.MutationOperator SHRINK
SHRINK replaces a randomly chosen subtree with a randomly chosen Terminal. This operator is useful for keeping down the size of trees.


EXPAND

public static final Mutation.MutationOperator EXPAND
EXPAND replaces a randomly chosen Terminal with a randomly chosen subtree. This operator should be used with care as it may cause bloat.


SWAP

public static final Mutation.MutationOperator SWAP
SWAP chooses a non-commutative binary node (such as SUBTRACT) and swaps the subtrees below this node


CONSTANT

public static final Mutation.MutationOperator CONSTANT
CONSTANT changes the value of a Constant node by a random amount (generated with a Gaussian distribution).

Method Detail

values

public static final Mutation.MutationOperator[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Mutation.MutationOperator c : Mutation.MutationOperator.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Mutation.MutationOperator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name