Package net.bmahe.genetics4j.gp.mutation
Class NodeReplacementMutator
java.lang.Object
net.bmahe.genetics4j.gp.mutation.NodeReplacementMutator
- All Implemented Interfaces:
Mutator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AbstractEAConfiguration
private final double
private final ProgramHelper
private final RandomGenerator
-
Constructor Summary
ConstructorsConstructorDescriptionNodeReplacementMutator
(ProgramHelper _programHelper, RandomGenerator _randomGenerator, AbstractEAConfiguration _eaConfiguration, double populationMutationProbability) -
Method Summary
Modifier and TypeMethodDescriptionduplicateAndReplaceNode
(Program program, TreeNode<Operation<?>> root, int cutPoint, int nodeIndex) duplicateNode
(Program program, TreeNode<Operation<?>> root, int cutPoint, int nodeIndex) protected List
<OperationFactory> findReplacementCandidates
(Program program, TreeNode<Operation<?>> root) Applies mutation to the given genotype and returns a new mutated genotype.
-
Field Details
-
programHelper
-
randomGenerator
-
eaConfiguration
-
populationMutationProbability
private final double populationMutationProbability
-
-
Constructor Details
-
NodeReplacementMutator
public NodeReplacementMutator(ProgramHelper _programHelper, RandomGenerator _randomGenerator, AbstractEAConfiguration _eaConfiguration, double populationMutationProbability)
-
-
Method Details
-
duplicateNode
-
findReplacementCandidates
protected List<OperationFactory> findReplacementCandidates(Program program, TreeNode<Operation<?>> root) -
duplicateAndReplaceNode
-
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
-