public final class ShrinkMutation extends Object implements GeneticOperator
The resulting offspring will be smaller than the parent.
Constructor and Description |
---|
ShrinkMutation(Random random,
PrimitiveSet primitiveSet)
Creates a
ShrinkMutation that uses a Random to select function nodes to replace with terminals from a PrimitiveSet . |
Modifier and Type | Method and Description |
---|---|
Node |
evolve(NodeSelector selector)
Returns a new
Node evolved from existing instances. |
public ShrinkMutation(Random random, PrimitiveSet primitiveSet)
ShrinkMutation
that uses a Random
to select function nodes to replace with terminals from a PrimitiveSet
.random
- used to randomly select function nodesprimitiveSet
- used to select terminal nodes to replace function nodes withpublic Node evolve(NodeSelector selector)
GeneticOperator
Node
evolved from existing instances.evolve
in interface GeneticOperator
selector
- used to select the existing instances to use as a basis for evolving a new instanceNode
evolved from existing instances obtained from selector
OakGP Genetic Programming Framework