Operator.Operations
Class TournamentSelect

java.lang.Object
  extended by Operator.Operations.SelectionOperation
      extended by Operator.Operations.TournamentSelect
All Implemented Interfaces:
Operation, ParameterI, Stochastic

public class TournamentSelect
extends SelectionOperation
implements Stochastic

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

rng

protected RandomNumberGenerator rng

tournamentSize

protected int tournamentSize

pressureModifier

protected double pressureModifier

tour

protected java.util.ArrayList<Fitness> tour
Constructor Detail

TournamentSelect

public TournamentSelect(int size,
                        int tourSize,
                        RandomNumberGenerator rand)
Creates a new instance of TournamentSelect

Parameters:
size - size of selected population
tourSize - size of tournament
rand - random number generator

TournamentSelect

public TournamentSelect(RandomNumberGenerator rand,
                        java.util.Properties p)
Creates a new instance of TournamentSelect

Parameters:
rand - random number generator
p - properties

TournamentSelect

public TournamentSelect()
New instantion

Method Detail

setProperties

public void setProperties(java.util.Properties p)
Description copied from class: SelectionOperation
Set properties

Specified by:
setProperties in interface ParameterI
Overrides:
setProperties in class SelectionOperation
Parameters:
p - object containing properties

doOperation

public void doOperation(Individual operand)
Description copied from interface: Operation
Performs the operation on an operand

Specified by:
doOperation in interface Operation
Specified by:
doOperation in class SelectionOperation
Parameters:
operand - operand to perform operation on

doOperation

public void doOperation(java.util.List<Individual> operands)
Individuals from operands will be added to the selected population if the win their tournament.

Specified by:
doOperation in interface Operation
Specified by:
doOperation in class SelectionOperation
Parameters:
operands - Individuals to be selected from

getTour

public void getTour(java.util.List<Individual> operands)
Adds individual to the tournament by randomly selecting from the operands untill the tounramentSize is reached.

Parameters:
operands - Individuals that can be selected to the tournament

selectFromTour

public void selectFromTour()
Select a winner from the tournament and add to the selected population.


setRNG

public void setRNG(RandomNumberGenerator m)
Description copied from interface: Stochastic
Set the number generator

Specified by:
setRNG in interface Stochastic
Parameters:
m - number generator

getRNG

public RandomNumberGenerator getRNG()
Description copied from interface: Stochastic
Get the number generator

Specified by:
getRNG in interface Stochastic
Returns:
number generator