Module io.jenetics.ext
Package io.jenetics.ext
Class WeaselProgram<G extends Gene<?,G>,C extends Comparable<? super C>>
java.lang.Object
io.jenetics.ext.WeaselProgram<G,C>
- Type Parameters:
G- the gene typeC- the fitness result type
- All Implemented Interfaces:
Engine.Setup<G,C>
public final class WeaselProgram<G extends Gene<?,G>,C extends Comparable<? super C>>
extends Object
implements Engine.Setup<G,C>
Configures the evolution engine to execute the
Weasel program
algorithm.
final Engine<CharacterGene, Integer> engine = Engine.builder(problem)
.setup(new WeaselProgram<>())
.build();
- Since:
- 6.0
- Version:
- 6.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new weasel program setup with the default mutation probability of0.05.WeaselProgram(double mutationProbability) Create a new weasel program setup with the give mutation probability. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(Engine.Builder<G, C> builder) Appliesthissetup to the given enginebuilder.
-
Constructor Details
-
WeaselProgram
Create a new weasel program setup with the give mutation probability.- Parameters:
mutationProbability- the mutation probability- Throws:
IllegalArgumentException- if themutationProbabilityis not in the valid range of[0, 1].
-
WeaselProgram
public WeaselProgram()Create a new weasel program setup with the default mutation probability of0.05.
-
-
Method Details
-
apply
Description copied from interface:Engine.SetupAppliesthissetup to the given enginebuilder.- Specified by:
applyin interfaceEngine.Setup<G extends Gene<?,G>, C extends Comparable<? super C>> - Parameters:
builder- the engine builder to set up (configure)
-