eaLib API Docs
Last Modified : January 7 2002

mss.ea.sel
Class FitnessTournamentSelection

java.lang.Object
  |
  +--mss.ea.core.GeneticOperator
        |
        +--mss.ea.sel.Selection
              |
              +--mss.ea.sel.TournamentSelection
                    |
                    +--mss.ea.sel.FitnessTournamentSelection
All Implemented Interfaces:
SingleStreamProcessor, StreamProcessor

public class FitnessTournamentSelection
extends TournamentSelection

Tournament selection by fitness.

Since:
0.2.3
Version:
$Revision: 1.5 $ $Date: 2001/12/11 13:17:38 $
Author:
Andreas Rummler

Field Summary
protected  FitnessComparator fitnessComparator
          Fitness comparator for use in tournament.
 
Fields inherited from class mss.ea.sel.TournamentSelection
comparator, rand, tournamentSize
 
Fields inherited from class mss.ea.sel.Selection
multSelection, numberPerSelection
 
Fields inherited from class mss.ea.core.GeneticOperator
description, ID, name
 
Constructor Summary
FitnessTournamentSelection(int numberPerSelection)
          Constructor with number per selection.
FitnessTournamentSelection(int numberPerSelection, int tourSize)
          Constructor with number per selection and tournament size.
FitnessTournamentSelection(int numberPerSelection, int tourSize, FitnessComparator comp)
          Constructor with number per selection, tournament size and individual comparator.
 
Method Summary
 IndividualStream select(IndividualStream is)
          Selects individuals from a stream.
protected  IndividualStream selectByComparator(IndividualStream is)
          Selects individuals by use of the previously set fitness comparator.
protected  IndividualStream selectByFitness(IndividualStream is)
          Selects individuals by calling the compare() method.
 
Methods inherited from class mss.ea.sel.TournamentSelection
getTournamentSize, selectByCompare, setTournamentSize
 
Methods inherited from class mss.ea.sel.Selection
getSelectionSize, process, setSelectionSize
 
Methods inherited from class mss.ea.core.GeneticOperator
getDescription, getID, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mss.ea.core.StreamProcessor
getName
 

Field Detail

fitnessComparator

protected FitnessComparator fitnessComparator
Fitness comparator for use in tournament.
Constructor Detail

FitnessTournamentSelection

public FitnessTournamentSelection(int numberPerSelection)
Constructor with number per selection.
Parameters:
numberPerSelection - number how many individuals are selected

FitnessTournamentSelection

public FitnessTournamentSelection(int numberPerSelection,
                                  int tourSize)
Constructor with number per selection and tournament size.
Parameters:
numberPerSelection - number how many individuals are selected
tourSize - size of the tournament

FitnessTournamentSelection

public FitnessTournamentSelection(int numberPerSelection,
                                  int tourSize,
                                  FitnessComparator comp)
Constructor with number per selection, tournament size and individual comparator.
Parameters:
numberPerSelection - number how many individuals are selected
tourSize - size of the tournament
comp - fitness comparator to use for comparisons
Method Detail

select

public IndividualStream select(IndividualStream is)
                        throws SelectionException
Selects individuals from a stream.
Overrides:
select in class TournamentSelection
Parameters:
is - stream to select individuals from
Returns:
stream with selected individuals
Throws:
SelectionException - thrown in case the selection mechanism fails

selectByFitness

protected IndividualStream selectByFitness(IndividualStream is)
Selects individuals by calling the compare() method.
Parameters:
is - stream to select individuals from
Returns:
stream with selected individuals

selectByComparator

protected IndividualStream selectByComparator(IndividualStream is)
Selects individuals by use of the previously set fitness comparator.
Overrides:
selectByComparator in class TournamentSelection
Parameters:
is - stream to select individuals from
Returns:
stream with selected individuals

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS