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

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

public class CompoundSelection
extends SelectionStrategy

This class implements the Composite design pattern to correctly apply a group of selection operators to perform a specific selection. For example, a selection my require an Elitism selection of 10% of the available entities, followed by a greedy fitness selection operator.

Author:
gpampara
See Also:
Serialized Form

Constructor Summary
CompoundSelection()
           
CompoundSelection(CompoundSelection copy)
           
 
Method Summary
 void addSelection(SelectionStrategy selectionOperator)
           
 SelectionStrategy getClone()
          Create a cloned copy of the current object and return it.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundSelection

public CompoundSelection()

CompoundSelection

public CompoundSelection(CompoundSelection copy)
Method Detail

getClone

public SelectionStrategy 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)
Description copied from class: SelectionStrategy
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.

performOperation

public void performOperation(TopologyHolder holder)
Description copied from interface: Operator
Perform the operator operation given the current TopologyHolder.

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

addSelection

public void addSelection(SelectionStrategy selectionOperator)


Copyright © 2009 CIRG. All Rights Reserved.