Class PointMutation
java.lang.Object
org.moeaframework.core.operator.program.PointMutation
- All Implemented Interfaces:
Configurable
,Mutation
,Variation
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 Summary
ConstructorDescriptionConstructs a new point mutation operator with the default settings.PointMutation
(double probability) Constructs a new point mutation operator. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns the name of this variation operator.double
Gets the probability of mutating a node in the tree.Mutates the given parent to produce an offspring.protected void
Applies point mutation to the specified node.void
setProbability
(double probability) Sets the probability of mutating a node in the tree.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfiguration
-
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
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. -
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
Description copied from interface:Mutation
Mutates the given parent to produce an offspring. -
mutate
Applies point mutation to the specified node.- Parameters:
node
- the node undergoing point mutationrules
- the rules defining the program syntax
-