JGAP

org.jgap.gp.impl
Class TournamentSelector

java.lang.Object
  extended by org.jgap.gp.impl.TournamentSelector
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, INaturalGPSelector

public class TournamentSelector
extends java.lang.Object
implements INaturalGPSelector, java.io.Serializable, java.lang.Cloneable

A GP tournament selector. The winner is determined by letting fight a number of opponents against each other. The best of all wins.

Since:
3.2
See Also:
Serialized Form

Constructor Summary
TournamentSelector()
          Constructor with default tournament size.
TournamentSelector(int a_tournament_size)
          Preferred Constructor.
 
Method Summary
 java.lang.Object clone()
           
 IGPProgram select(GPGenotype a_genotype)
          Does the tournament selection.
 void setTournamentSize(int a_tournament_size)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TournamentSelector

public TournamentSelector()
Constructor with default tournament size.

Since:
3.2

TournamentSelector

public TournamentSelector(int a_tournament_size)
Preferred Constructor.

Parameters:
a_tournament_size - the size of the tournament
Since:
3.2
Method Detail

setTournamentSize

public void setTournamentSize(int a_tournament_size)
Parameters:
a_tournament_size - the size of the tournament
Since:
3.4

select

public IGPProgram select(GPGenotype a_genotype)
Does the tournament selection.

Specified by:
select in interface INaturalGPSelector
Parameters:
a_genotype - the genotype containing the competers
Returns:
program that won the tournament
Since:
3.2

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
Returns:
deep clone of this instance
Since:
3.2

JGAP