Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.select
Class RouletteWheelSelector

java.lang.Object
  extended byorg.evolvica.engine.AbstractOperator
      extended byorg.evolvica.core.common.AbstractGeneticOperator
          extended byorg.evolvica.core.select.AbstractSelector
              extended byorg.evolvica.core.select.RouletteWheelSelector
All Implemented Interfaces:
IGeneticOperator, IOperator, IProcessor, java.io.Serializable

public class RouletteWheelSelector
extends AbstractSelector

Roulette Wheel Selection.

Since:
0.4.0
Version:
$Revision: 1.8 $ $Date: 2004/05/26 11:58:17 $
Author:
Andreas Rummler
See Also:
Serialized Form

Field Summary
protected  float[] bounds
          Array with line segments.
 
Fields inherited from class org.evolvica.core.select.AbstractSelector
allowMultipleSelection, numberPerSelection
 
Fields inherited from class org.evolvica.engine.AbstractOperator
descriptor, element, id, name
 
Constructor Summary
RouletteWheelSelector()
          Constructor.
RouletteWheelSelector(int numberPerSelection)
          Constructor with number per selection.
 
Method Summary
 IIndividual[] select(IIndividual[] pool)
          Selects individuals out of a given selection pool.
protected  void setupLineArray(IIndividual[] pool)
          Sets up the array of selection propabilities.
protected  int spinWheel(IIndividual[] pool)
          Spins the roulette wheel and returns the diced number.
protected  float totalFitness(IIndividual[] pool)
          Helper for adding all fitness values of the collection.
 
Methods inherited from class org.evolvica.core.select.AbstractSelector
getNumberPerSelection, process, setNumberPerSelection
 
Methods inherited from class org.evolvica.engine.AbstractOperator
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.evolvica.engine.IOperator
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName
 

Field Detail

bounds

protected float[] bounds
Array with line segments.

Constructor Detail

RouletteWheelSelector

public RouletteWheelSelector()
Constructor.


RouletteWheelSelector

public RouletteWheelSelector(int numberPerSelection)
Constructor with number per selection.

Parameters:
numberPerSelection - number of individuals per selection
Method Detail

select

public IIndividual[] select(IIndividual[] pool)
Description copied from class: AbstractSelector
Selects individuals out of a given selection pool.

Specified by:
select in class AbstractSelector
Parameters:
pool - selection pool
Returns:
selected individuals
See Also:
AbstractSelector.select(org.evolvica.core.IIndividual[])

setupLineArray

protected void setupLineArray(IIndividual[] pool)
Sets up the array of selection propabilities.

Parameters:
pool - selection pool

spinWheel

protected int spinWheel(IIndividual[] pool)
Spins the roulette wheel and returns the diced number.

Parameters:
pool - selection pool
Returns:
number generated by the wheel

totalFitness

protected float totalFitness(IIndividual[] pool)
Helper for adding all fitness values of the collection.

Parameters:
pool - selection pool
Returns:
sum of all fitness values

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems