org.jgap.gp.impl
Class TournamentSelector
- java.lang.Object
-
- 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
Constructors Constructor and Description TournamentSelector()Constructor with default tournament size.TournamentSelector(int a_tournament_size)Preferred Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()IGPProgramselect(GPGenotype a_genotype)Does the tournament selection.voidsetTournamentSize(int a_tournament_size)
-
-
-
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:
selectin interfaceINaturalGPSelector- Parameters:
a_genotype- the genotype containing the competers- Returns:
- program that won the tournament
- Since:
- 3.2
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.lang.Object- Returns:
- deep clone of this instance
- Since:
- 3.2
-
-
DMelt 3.0 © DataMelt by jWork.ORG