|
Watchmaker Framework for Evolutionary Computation API (Version 0.7.1) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.uncommons.watchmaker.framework.selection.TruncationSelection
public class TruncationSelection
Implements selection of n candidates from a population by simply selecting the n candidates with the highest fitness scores (the rest are discarded). A candidate is never selected more than once.
Constructor Summary | |
---|---|
TruncationSelection(double selectionRatio)
|
|
TruncationSelection(NumberGenerator<Double> selectionRatio)
Creates a truncation selection strategy that is controlled by the variable selection ratio provided by the specified NumberGenerator . |
Method Summary | ||
---|---|---|
|
select(List<EvaluatedCandidate<S>> population,
boolean naturalFitnessScores,
int selectionSize,
Random rng)
Selects the fittest candidates. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TruncationSelection(NumberGenerator<Double> selectionRatio)
NumberGenerator
.
selectionRatio
- A number generator that produces values in
the range 0 < r < 1. These values are used to determine
the proportion of the population that is retained in any given selection.public TruncationSelection(double selectionRatio)
selectionRatio
- The proportion of the highest ranked candidates to
select from the population. The value must be positive and less than 1.Method Detail |
---|
public <S> List<S> select(List<EvaluatedCandidate<S>> population, boolean naturalFitnessScores, int selectionSize, Random rng)
select
in interface SelectionStrategy<Object>
S
- The type of evolved entity that is being selected.population
- The population of evolved and evaluated candidates
from which to select.naturalFitnessScores
- Whether higher fitness values represent fitter
individuals or not.selectionSize
- The number of candidates to select from the
evolved population.rng
- A source of randomness (not used by this selection
implementation since truncation selection is deterministic).
public String toString()
toString
in class Object
|
Watchmaker Framework for Evolutionary Computation API (Version 0.7.1) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |