jenes.stage.operator.common
Class TournamentSelector<T extends Chromosome>

java.lang.Object
  extended by jenes.stage.AbstractStage<T>
      extended by jenes.stage.operator.Operator<T>
          extended by jenes.stage.operator.Selector<T>
              extended by jenes.stage.operator.common.TournamentSelector<T>
Type Parameters:
T - The class of chromosomes to work with.

public class TournamentSelector<T extends Chromosome>
extends Selector<T>

A classic tournament selection operator. A number of attempts is specified at the instantiation time; it represents the number of iterations the selection procedure is repeated. Individuals are randomly choosen and the one with the best fitness will be selected.

The Selector.preSelect(Population) method is useless, so there is an overriding implementation in this selection algorithm.

Since:
1.0
Version:
1.2
Author:
Luigi Troiano, Pierpaolo Lombardi, Giuseppe Pascale, Thierry Bodhuin
See Also:
Individual, Population

Nested Class Summary
 
Nested classes/interfaces inherited from class jenes.stage.operator.Selector
Selector.Statistics
 
Field Summary
 
Fields inherited from class jenes.stage.operator.Selector
DEFAULT_MAX_ILLEGAL_RATE
 
Fields inherited from class jenes.stage.operator.Operator
random, statistics
 
Fields inherited from class jenes.stage.AbstractStage
biggerIsBetter, ga
 
Constructor Summary
TournamentSelector(int attempts)
          Constructs a new tournament selection object
 
Method Summary
 int getAttempts()
          Returns the number of attempts of this tournament selection
protected  Individual<T> select(Population<T> pop)
          Selects a population according to a politics of selection.
 
Methods inherited from class jenes.stage.operator.Selector
getMaxIllegalRate, preSelect, process, setMaxIllegalRate
 
Methods inherited from class jenes.stage.operator.Operator
getStatistics, updateStatistics
 
Methods inherited from class jenes.stage.AbstractStage
dispose, init, isBiggerBetter, setBiggerIsBetter, setBiggerIsBetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TournamentSelector

public TournamentSelector(int attempts)
Constructs a new tournament selection object

Parameters:
attempts - the number of tournament attempts
Method Detail

getAttempts

public int getAttempts()
Returns the number of attempts of this tournament selection

Returns:
the number of attempts

select

protected Individual<T> select(Population<T> pop)
Description copied from class: Selector
Selects a population according to a politics of selection.

Specified by:
select in class Selector<T extends Chromosome>
Parameters:
pop - the population in which to choose the individual
Returns:
the position selected