|
Evolvica Core API Version 0.6.2 Last Modified: June 29 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.evolvica.engine.AbstractOperator
org.evolvica.core.common.AbstractGeneticOperator
org.evolvica.core.select.AbstractSelector
org.evolvica.core.select.TournamentSelector
Tournament Selection. This class implements a tournament selection. In this variant tournaments are executed between random individuals. The best individual wins the tournament and is selected.
Field Summary | |
protected IIndividualComparator |
comparator
Individual comparator for use in tournament. |
protected int |
tournamentSize
Number of individuals attending a tournament. |
Fields inherited from class org.evolvica.core.select.AbstractSelector |
allowMultipleSelection, numberPerSelection |
Fields inherited from class org.evolvica.engine.AbstractOperator |
descriptor, element, id, name |
Constructor Summary | |
TournamentSelector()
Constructor. |
|
TournamentSelector(int numberPerSelection,
int tournamentSize,
IIndividualComparator comparator)
Constructor with number per selection, tournament size and individual comparator. |
Method Summary | |
IIndividualComparator |
getComparator()
Returns the comparator. |
int |
getTournamentSize()
Gets the current tournament size. |
IIndividual[] |
select(IIndividual[] pool)
Selects individuals out of a given selection pool. |
protected IIndividual |
selectWinner(IIndividual[] pool)
Selects a winner. |
void |
setComparator(IIndividualComparator comparator)
Sets the comparator. |
void |
setTournamentSize(int tournamentSize)
Sets a new tournament size. |
Methods inherited from class org.evolvica.core.select.AbstractSelector |
getNumberPerSelection, process, setNumberPerSelection |
Methods inherited from class org.evolvica.engine.AbstractOperator |
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.evolvica.engine.IOperator |
attachDescriptor, attachElement, descriptor, element, getId, getName, setId, setName |
Field Detail |
protected int tournamentSize
protected IIndividualComparator comparator
Constructor Detail |
public TournamentSelector()
public TournamentSelector(int numberPerSelection, int tournamentSize, IIndividualComparator comparator)
numberPerSelection
- number how many individuals are selectedtournamentSize
- size of the tournamentcomparator
- individual comparator to use for comparisonsMethod Detail |
public IIndividual[] select(IIndividual[] pool)
AbstractSelector
select
in class AbstractSelector
pool
- selection pool
AbstractSelector.select(org.evolvica.core.IIndividual[])
protected IIndividual selectWinner(IIndividual[] pool)
pool
- tournament attendees
public void setTournamentSize(int tournamentSize) throws java.beans.PropertyVetoException
tournamentSize
- new tournament size
java.beans.PropertyVetoException
- thrown in case the property cannot be setpublic int getTournamentSize()
public IIndividualComparator getComparator()
public void setComparator(IIndividualComparator comparator)
comparator
- comparator
|
Evolvica Core API Version 0.6.2 Last Modified: June 29 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |