Module io.jenetics.ext
Package io.jenetics.ext
Class TreeRewriteAlterer<A,G extends TreeGene<A,G>,C extends Comparable<? super C>>
java.lang.Object
io.jenetics.AbstractAlterer<G,C>
io.jenetics.Mutator<G,C>
io.jenetics.ext.TreeMutator<A,G,C>
io.jenetics.ext.TreeRewriteAlterer<A,G,C>
- All Implemented Interfaces:
Alterer<G,
C>
- Direct Known Subclasses:
MathRewriteAlterer
public class TreeRewriteAlterer<A,G extends TreeGene<A,G>,C extends Comparable<? super C>>
extends TreeMutator<A,G,C>
This alterer uses a
TreeRewriter
for altering the TreeChromosome
.- Since:
- 5.0
- Version:
- 5.0
- See Also:
-
Field Summary
Fields inherited from class io.jenetics.AbstractAlterer
_probability
Fields inherited from interface io.jenetics.Alterer
DEFAULT_ALTER_PROBABILITY
-
Constructor Summary
ConstructorDescriptionTreeRewriteAlterer
(TreeRewriter<A> rewriter) Create a new alterer with the givenrewriter
.TreeRewriteAlterer
(TreeRewriter<A> rewriter, double probability) Create a new alterer with the givenrewriter
.TreeRewriteAlterer
(TreeRewriter<A> rewriter, int limit) Create a new alterer with the givenrewriter
and given rewritelimit
.TreeRewriteAlterer
(TreeRewriter<A> rewriter, int limit, double probability) Create a new alterer with the givenrewriter
and given rewritelimit
. -
Method Summary
Methods inherited from class io.jenetics.ext.TreeMutator
mutate
Methods inherited from class io.jenetics.AbstractAlterer
probability
-
Constructor Details
-
TreeRewriteAlterer
Create a new alterer with the givenrewriter
and given rewritelimit
.- Parameters:
rewriter
- the tree rewriterlimit
- the rewriting limitprobability
- the altering probability- Throws:
NullPointerException
- if therewriter
isnull
-
TreeRewriteAlterer
Create a new alterer with the givenrewriter
and given rewritelimit
.- Parameters:
rewriter
- the tree rewriterlimit
- the rewriting limit- Throws:
NullPointerException
- if therewriter
isnull
-
TreeRewriteAlterer
Create a new alterer with the givenrewriter
.- Parameters:
rewriter
- the tree rewriterprobability
- the altering probability- Throws:
NullPointerException
- if therewriter
isnull
-
TreeRewriteAlterer
Create a new alterer with the givenrewriter
.- Parameters:
rewriter
- the tree rewriter- Throws:
NullPointerException
- if therewriter
isnull
-
-
Method Details
-
mutate
Performs the actual tree rewriting.- Specified by:
mutate
in classTreeMutator<A,
G extends TreeGene<A, G>, C extends Comparable<? super C>> - Parameters:
tree
- the tree to rewrite
-