Package net.bmahe.genetics4j.gp.mutation
Class TrimTreeMutator
java.lang.Object
net.bmahe.genetics4j.gp.mutation.TrimTreeMutator
- All Implemented Interfaces:
Mutator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AbstractEAConfiguration
static final org.apache.logging.log4j.Logger
private final ProgramGenerator
private final RandomGenerator
private final TrimTree
-
Constructor Summary
ConstructorsConstructorDescriptionTrimTreeMutator
(ProgramGenerator _programGenerator, RandomGenerator _randomGenerator, AbstractEAConfiguration _eaConfiguration, TrimTree _trimTree) -
Method Summary
Modifier and TypeMethodDescriptionduplicateAndMutate
(Program program, TreeNode<Operation<?>> root, int maxDepth, int currentDepth) private int
maxDepthValue
(Program program, TrimTree trimTree) Applies mutation to the given genotype and returns a new mutated genotype.
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
programGenerator
-
randomGenerator
-
eaConfiguration
-
trimTree
-
-
Constructor Details
-
TrimTreeMutator
public TrimTreeMutator(ProgramGenerator _programGenerator, RandomGenerator _randomGenerator, AbstractEAConfiguration _eaConfiguration, TrimTree _trimTree)
-
-
Method Details
-
duplicateAndMutate
-
maxDepthValue
-
mutate
Description copied from interface:Mutator
Applies mutation to the given genotype and returns a new mutated genotype.The original genotype should not be modified; instead, a new genotype with the mutations applied should be returned. The specific mutation behavior depends on the implementation and the mutation policy being used.
Mutation may affect:
- Individual alleles within chromosomes (bit flips, value changes)
- Chromosome structure (for variable-length representations)
- Multiple chromosomes simultaneously
-