Operator.Operations.ContextSensitiveOperations
Class SubtreeMutation
java.lang.Object
Operator.Operations.MutationOperation
Operator.Operations.ContextSensitiveOperations.SubtreeMutation
- All Implemented Interfaces:
- Operation, ParameterI, Stochastic
public class SubtreeMutation
- extends MutationOperation
Pick a single point to mutate, but having mutated, remove all the codons that
used to define the old branch, and then follow the new branch, randomly
generating values to pick productions, until a complete branch is built
or the maximum depth is reached. This preserves all branches that were not
part of the chosen [mutated] branch
- Author:
- eliott bartley
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
initialiser
protected Initialiser initialiser
SubtreeMutation
public SubtreeMutation(RandomNumberGenerator rng,
java.util.Properties p)
SubtreeMutation
public SubtreeMutation(double prob,
RandomNumberGenerator rng)
setCreationOperation
public void setCreationOperation(CreationOperation creationOperation)
doOperation
public void doOperation(Individual operand)
- Description copied from interface:
Operation
- Performs the operation on an operand
- Specified by:
doOperation
in interface Operation
- Specified by:
doOperation
in class MutationOperation
- Parameters:
operand
- operand to perform operation on
getMaxDTIndex
public int getMaxDTIndex(DerivationTree dT)
doOperation
public void doOperation(java.util.List<Individual> operands)
- Description copied from interface:
Operation
- Performs the operation on the list passed
- Specified by:
doOperation
in interface Operation
- Specified by:
doOperation
in class MutationOperation
- Parameters:
operands
- operands to be operated on
getInitialiser
protected Initialiser getInitialiser(GEGrammar g,
RandomNumberGenerator rng,
java.util.Properties p)
- Load and initialise the initialiser class according to the parameters
Defualt initialiser is the RandomInitialiser.
To add other initialisers expand the if-statement with another clause
- Parameters:
g
- GEGrammarrng
- RandomNumberGeneratorp
- Properties
- Returns:
- Intialiser