net.sourceforge.cilib.entity.operators.selection
Class TournamentSelectionStrategy

java.lang.Object
  extended by net.sourceforge.cilib.entity.operators.selection.SelectionStrategy
      extended by net.sourceforge.cilib.entity.operators.selection.TournamentSelectionStrategy
All Implemented Interfaces:
Serializable, Operator, Cloneable

public class TournamentSelectionStrategy
extends SelectionStrategy

Perform a tournament selection process on the provided Topology with a predefined tournament size.

Author:
Gary Pampara
See Also:
Serialized Form

Constructor Summary
TournamentSelectionStrategy()
          Create a new instance of TournamentSelectionStrategy.
TournamentSelectionStrategy(TournamentSelectionStrategy copy)
          Copy constructor.
 
Method Summary
 TournamentSelectionStrategy getClone()
          Create a cloned copy of the current object and return it.
 ControlParameter getTournamentSize()
          Get the defined size of the tournament.
 void performOperation(TopologyHolder holder)
          Perform the operator operation given the current TopologyHolder.
<T extends Entity>
T
select(Topology<T> population)
          Apply the selection strategy and return a single Entity.
 void setTournamentSize(ControlParameter tournamanetSize)
          Set the size of the tournament.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TournamentSelectionStrategy

public TournamentSelectionStrategy()
Create a new instance of TournamentSelectionStrategy.


TournamentSelectionStrategy

public TournamentSelectionStrategy(TournamentSelectionStrategy copy)
Copy constructor. Create a copy of the given instance.

Parameters:
copy - The instance to copy.
Method Detail

getClone

public TournamentSelectionStrategy getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Operator
Specified by:
getClone in interface Cloneable
Specified by:
getClone in class SelectionStrategy
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

select

public <T extends Entity> T select(Topology<T> population)
Apply the selection strategy and return a single Entity.

Specified by:
select in class SelectionStrategy
Type Parameters:
T - The Entity type.
Parameters:
population - The Topology to make the selection from.
Returns:
The selected Entity.

getTournamentSize

public ControlParameter getTournamentSize()
Get the defined size of the tournament.

Returns:
The size of the tournament.

setTournamentSize

public void setTournamentSize(ControlParameter tournamanetSize)
Set the size of the tournament.

Parameters:
tournamanetSize - The size of the tournament to set.

performOperation

public void performOperation(TopologyHolder holder)
Perform the operator operation given the current TopologyHolder.

Parameters:
holder - The TopologyHolder representing the required Topology instances.


Copyright © 2009 CIRG. All Rights Reserved.