net.sourceforge.cilib.coevolution.selection
Class OpponentSelectionStrategy

java.lang.Object
  extended by net.sourceforge.cilib.coevolution.selection.OpponentSelectionStrategy
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
SelectAllOpponentSelectionStrategy, SelectNOpponentSelectionStrategy

public abstract class OpponentSelectionStrategy
extends Object
implements Cloneable

This class determins how opponents are selected from the opponent pool. A List of OpponentPoolSelectionStrategy's is maintained by this class to dictate how the opponent pool is selected.

Author:
Julien Duhain, leo
See Also:
Serialized Form

Field Summary
protected  int ownPopulationID
           
protected  boolean selectFromOwnPopulation
           
 
Constructor Summary
OpponentSelectionStrategy()
           
OpponentSelectionStrategy(OpponentSelectionStrategy copy)
           
 
Method Summary
 void addPoolSelectionStrategy(OpponentPoolSelectionStrategy strategy)
           
 void clearPoolSelectionStrategies()
           
abstract  OpponentSelectionStrategy getClone()
          Create a cloned copy of the current object and return it.
abstract  CoevolutionCompetitorList selectCompetitors(CoevolutionCompetitorList pool)
          Select opponents from the pool
 CoevolutionCompetitorList setCompetitors(int currentPopulationID, List<PopulationBasedAlgorithm> populations)
          Creates the opponent pool with an arbitrary number of OpponentPoolSelectionStrategys and select opponents from it.
 void setOwnPopulationID(int ownPopulationID)
           
 void setSelectFromOwnPopulation(boolean selectFromOwnPopulation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ownPopulationID

protected int ownPopulationID

selectFromOwnPopulation

protected boolean selectFromOwnPopulation
Constructor Detail

OpponentSelectionStrategy

public OpponentSelectionStrategy()

OpponentSelectionStrategy

public OpponentSelectionStrategy(OpponentSelectionStrategy copy)
Method Detail

getClone

public abstract OpponentSelectionStrategy 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 Cloneable
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

selectCompetitors

public abstract CoevolutionCompetitorList selectCompetitors(CoevolutionCompetitorList pool)
Select opponents from the pool

Parameters:
pool - the pool of potential opponents
Returns:
the selected opponents

setCompetitors

public CoevolutionCompetitorList setCompetitors(int currentPopulationID,
                                                List<PopulationBasedAlgorithm> populations)
Creates the opponent pool with an arbitrary number of OpponentPoolSelectionStrategys and select opponents from it.

Parameters:
populationID - id of current pop
populations - the sub populations of the competitive coevolution algorithm
Returns:
list of selected opponents

setOwnPopulationID

public void setOwnPopulationID(int ownPopulationID)

setSelectFromOwnPopulation

public void setSelectFromOwnPopulation(boolean selectFromOwnPopulation)

addPoolSelectionStrategy

public void addPoolSelectionStrategy(OpponentPoolSelectionStrategy strategy)

clearPoolSelectionStrategies

public void clearPoolSelectionStrategies()


Copyright © 2009 CIRG. All Rights Reserved.