|
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.RouletteWheelSelection
public class RouletteWheelSelection
Implements selection of n candidates from a population by selecting
n candidates at random where the probability of each candidate getting
selected is proportional to its fitness score. This is analogous to each
candidate being assigned an area on a roulette wheel proportionate to its fitness
and the wheel being spun
In some instances, particularly with small population sizes, the randomness
of selection may result in excessively high occurrences of particular candidates.
If this is a problem, StochasticUniversalSampling
provides an alternative
fitness-proportionate strategy for selection.
Constructor Summary | |
---|---|
RouletteWheelSelection()
|
Method Summary | ||
---|---|---|
|
select(List<EvaluatedCandidate<S>> population,
boolean naturalFitnessScores,
int selectionSize,
Random rng)
Selects the required number of candidates from the population with the probability of selecting any particular candidate being proportional to that candidate's fitness score. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RouletteWheelSelection()
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 the evolved objects in the population.population
- The candidates to select from.naturalFitnessScores
- True if higher fitness scores indicate fitter
individuals, false if lower fitness scores indicate fitter individuals.selectionSize
- The number of selections to make.rng
- A source of randomness.
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 |