mss.ea.sel
Class RouletteWheelSelection
java.lang.Object
|
+--mss.ea.core.GeneticOperator
|
+--mss.ea.sel.Selection
|
+--mss.ea.sel.RouletteWheelSelection
- All Implemented Interfaces:
- SingleStreamProcessor, StreamProcessor
- Direct Known Subclasses:
- StochasticUniversalSelection
- public class RouletteWheelSelection
- extends Selection
Roulette Wheel Selection.
- Since:
- 0.1
- Version:
- 0.1 (06-03-2001)
- Author:
- Andreas Rummler
Field Summary |
protected float[] |
bounds
Array with line segments. |
protected java.util.Random |
rand
Random generator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
bounds
protected float[] bounds
- Array with line segments.
rand
protected java.util.Random rand
- Random generator.
RouletteWheelSelection
public RouletteWheelSelection(int numberPerSelection)
- Constructor with number per selection.
- Parameters:
numberPerSelection
- number of individuals per selection
select
public IndividualStream select(IndividualStream is)
- Description copied from class:
Selection
- Abstract select method.
Selects individuals. This method depends on the kind of the selection operator and must be implemented
by each subclass. It should be discussed, if this method should be protected.
- Overrides:
select
in class Selection
- Following copied from class:
mss.ea.sel.Selection
- Parameters:
is
- stream of individuals to select from- Returns:
- stream of selected individuals
- Throws:
SelectionException
- thrown in case the selection mechanism fails
setupLineArray
protected void setupLineArray(IndividualStream is)
spinWheel
protected int spinWheel(IndividualStream is)
- Spins the roulette wheel and returns the diced number.
getTotalFitness
protected float getTotalFitness(IndividualStream is)
- Helper for adding all fitness values of the stream.
- Returns:
- sum of all fitness values
Copyright © 2000-2001 Technical University of Ilmenau, Department ESS