|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectOperator.Operations.SelectionOperation
Operator.Operations.TournamentSelect
public class TournamentSelect
The operation of this class is tournament selection. The individual with the best fitness from a randomly selected tournament of size tournamentSize is cloned to the selected population.
| Field Summary | |
|---|---|
protected double |
pressureModifier
|
protected RandomNumberGenerator |
rng
|
protected java.util.ArrayList<Fitness> |
tour
|
protected int |
tournamentSize
|
| Fields inherited from class Operator.Operations.SelectionOperation |
|---|
selectedPopulation, size |
| Constructor Summary | |
|---|---|
TournamentSelect()
New instantion |
|
TournamentSelect(int size,
int tourSize,
RandomNumberGenerator rand)
Creates a new instance of TournamentSelect |
|
TournamentSelect(RandomNumberGenerator rand,
java.util.Properties p)
Creates a new instance of TournamentSelect |
|
| Method Summary | |
|---|---|
void |
doOperation(Individual operand)
Performs the operation on an operand |
void |
doOperation(java.util.List<Individual> operands)
Individuals from operands will be added to the selected population if the win their tournament. |
RandomNumberGenerator |
getRNG()
Get the number generator |
void |
getTour(java.util.List<Individual> operands)
Adds individual to the tournament by randomly selecting from the operands untill the tounramentSize is reached. |
void |
selectFromTour()
Select a winner from the tournament and add to the selected population. |
void |
setProperties(java.util.Properties p)
Set properties |
void |
setRNG(RandomNumberGenerator m)
Set the number generator |
| Methods inherited from class Operator.Operations.SelectionOperation |
|---|
getSelectedPopulation, getSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RandomNumberGenerator rng
protected int tournamentSize
protected double pressureModifier
protected java.util.ArrayList<Fitness> tour
| Constructor Detail |
|---|
public TournamentSelect(int size,
int tourSize,
RandomNumberGenerator rand)
size - size of selected populationtourSize - size of tournamentrand - random number generator
public TournamentSelect(RandomNumberGenerator rand,
java.util.Properties p)
rand - random number generatorp - propertiespublic TournamentSelect()
| Method Detail |
|---|
public void setProperties(java.util.Properties p)
SelectionOperation
setProperties in interface ParameterIsetProperties in class SelectionOperationp - object containing propertiespublic void doOperation(Individual operand)
Operation
doOperation in interface OperationdoOperation in class SelectionOperationoperand - operand to perform operation onpublic void doOperation(java.util.List<Individual> operands)
doOperation in interface OperationdoOperation in class SelectionOperationoperands - Individuals to be selected frompublic void getTour(java.util.List<Individual> operands)
operands - Individuals that can be selected to the tournamentpublic void selectFromTour()
public void setRNG(RandomNumberGenerator m)
Stochastic
setRNG in interface Stochasticm - number generatorpublic RandomNumberGenerator getRNG()
Stochastic
getRNG in interface Stochastic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||