org.encog.ml.ea.opp.selection
Class TruncationSelection
- java.lang.Object
-
- org.encog.ml.ea.opp.selection.TruncationSelection
-
- All Implemented Interfaces:
- java.io.Serializable, SelectionOperator
public class TruncationSelection extends java.lang.Object implements SelectionOperator, java.io.Serializable
Truncation selection chooses a random genome from the top genomes in the population. A percent determines how large this group of top genomes is. http://en.wikipedia.org/wiki/Truncation_selection- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description TruncationSelection(EvolutionaryAlgorithm theTrainer, double thePercent)Construct the truncation selector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description EvolutionaryAlgorithmgetTrainer()intperformAntiSelection(java.util.Random rnd, Species species)Selects an unfit genome.intperformSelection(java.util.Random rnd, Species species)Selects an fit genome.
-
-
-
Constructor Detail
-
TruncationSelection
public TruncationSelection(EvolutionaryAlgorithm theTrainer, double thePercent)
Construct the truncation selector.- Parameters:
theTrainer- The trainer.thePercent- The top percent to select from.
-
-
Method Detail
-
performSelection
public int performSelection(java.util.Random rnd, Species species)Selects an fit genome.- Specified by:
performSelectionin interfaceSelectionOperator- Parameters:
rnd- A random number generator.species- The species to select the genome from.- Returns:
- The selected genome.
-
performAntiSelection
public int performAntiSelection(java.util.Random rnd, Species species)Selects an unfit genome.- Specified by:
performAntiSelectionin interfaceSelectionOperator- Parameters:
rnd- A random number generator.species- The species to select the genome from.- Returns:
- The selected genome.
-
getTrainer
public EvolutionaryAlgorithm getTrainer()
- Specified by:
getTrainerin interfaceSelectionOperator- Returns:
- The trainer being used.
-
-
DMelt 3.0 © DataMelt by jWork.ORG