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:
WeaselSelector
,WeaselMutator
-
-
Constructor Summary
Constructors Constructor Description WeaselProgram()
Create 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.
-
-
-
Constructor Detail
-
WeaselProgram
public WeaselProgram(double mutationProbability)
Create a new weasel program setup with the give mutation probability.- Parameters:
mutationProbability
- the mutation probability- Throws:
IllegalArgumentException
- if themutationProbability
is 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 Detail
-
apply
public void apply(Engine.Builder<G,C> builder)
- Specified by:
apply
in interfaceEngine.Setup<G extends Gene<?,G>,C extends Comparable<? super C>>
-
-