public class TruncationSelection extends java.lang.Object implements SelectionOperator, java.io.Serializable
| Constructor and Description |
|---|
TruncationSelection(EvolutionaryAlgorithm theTrainer,
double thePercent)
Construct the truncation selector.
|
| Modifier and Type | Method and Description |
|---|---|
EvolutionaryAlgorithm |
getTrainer() |
int |
performAntiSelection(java.util.Random rnd,
Species species)
Selects an unfit genome.
|
int |
performSelection(java.util.Random rnd,
Species species)
Selects an fit genome.
|
public TruncationSelection(EvolutionaryAlgorithm theTrainer, double thePercent)
theTrainer - The trainer.thePercent - The top percent to select from.public int performSelection(java.util.Random rnd,
Species species)
performSelection in interface SelectionOperatorrnd - A random number generator.species - The species to select the genome from.public int performAntiSelection(java.util.Random rnd,
Species species)
performAntiSelection in interface SelectionOperatorrnd - A random number generator.species - The species to select the genome from.public EvolutionaryAlgorithm getTrainer()
getTrainer in interface SelectionOperator