- All Implemented Interfaces:
- ParentSelector, Serializable
public class RouletteWheel
- extends Object
- implements ParentSelector
An implementation of weighted roulette wheel selection. Each Individual in
the Population is given a slot on a hypothetical roulette wheel. The size of
each Individual's slot is proportional to its fitness. The wheel is then spun
and the Individual on which it stops is selected as the parent.
This ParentSelector only works if all individuals have positive fitness. Use
a FitnessScaler in order to work with populations where non-positive fitness
values are valid.
- Jan 7, 2007
- Grant Braught, Dickinson College
- See Also:
- Serialized Form
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Individual pickParent(Population pop)
- Use a weighted roulette wheel technique to select an Individual from the
- Specified by:
pickParent in interface
pop - the Population to choose from.
- the Individual selected to become a Parent.
IllegalStateException - if any Individual has negative fitness or if
all Individuals have 0 fitness.