edu.udo.cs.yale.operator.features.selection
Class RouletteWheel
java.lang.Object
edu.udo.cs.yale.operator.features.selection.RouletteWheel
- All Implemented Interfaces:
- PopulationOperator
- Direct Known Subclasses:
- BoltzmannSelection
public class RouletteWheel
- extends java.lang.Object
- implements PopulationOperator
Selects a given fixed number of individuals by subdividing a roulette wheel
in sections of size proportional to the individuals' fitness values.
Optionally keep the best individual.
- Version:
- $Id: RouletteWheel.java,v 1.4 2006/08/03 14:39:29 ingomierswa Exp $
- Author:
- Simon Fischer, Ingo Mierswa
Constructor Summary |
RouletteWheel(int popSize,
boolean keepBest,
java.util.Random random)
|
Method Summary |
double |
filterFitness(double fitness)
Subclasses may override this method and recalculate the fitness based on
the given one, e.g. |
void |
operate(Population population)
Modifies the population. |
boolean |
performOperation(int generation)
The default implementation returns true for every generation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
popSize
private int popSize
keepBest
private boolean keepBest
random
private java.util.Random random
RouletteWheel
public RouletteWheel(int popSize,
boolean keepBest,
java.util.Random random)
performOperation
public boolean performOperation(int generation)
- The default implementation returns true for every generation.
- Specified by:
performOperation
in interface PopulationOperator
filterFitness
public double filterFitness(double fitness)
- Subclasses may override this method and recalculate the fitness based on
the given one, e.g. Boltzmann selection or scaled selection. The default
implementation simply returns the given fitness.
operate
public void operate(Population population)
- Description copied from interface:
PopulationOperator
- Modifies the population.
- Specified by:
operate
in interface PopulationOperator
Copyright © 2001-2006