org.vizzini.ai.geneticalgorithm
Class AbstractSelector

java.lang.Object
  extended by org.vizzini.ai.geneticalgorithm.AbstractSelector
All Implemented Interfaces:
ISelector
Direct Known Subclasses:
FitnessProportionalSelector, RandomSelector

public abstract class AbstractSelector
extends Object
implements ISelector

Provides base functionality for a selector in a genetic algorithm.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson

Constructor Summary
AbstractSelector()
           
 
Method Summary
protected  void checkState()
          Check the state of this object for validity.
 int getLastIndex()
          Return the last index selected, or -1 if none.
protected  IPopulation getPopulation()
           
 void init(IPopulation population)
          Initialize this selector from the given population.
protected  void setLastIndex(int lastIndex)
           
protected  void setPopulation(IPopulation population)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.vizzini.ai.geneticalgorithm.ISelector
selectNext
 

Constructor Detail

AbstractSelector

public AbstractSelector()
Method Detail

getLastIndex

public int getLastIndex()
Return the last index selected, or -1 if none.

Specified by:
getLastIndex in interface ISelector
Since:
v0.3

init

public void init(IPopulation population)
Initialize this selector from the given population.

Specified by:
init in interface ISelector
Since:
v0.3

checkState

protected void checkState()
Check the state of this object for validity.

Since:
v0.3

getPopulation

protected IPopulation getPopulation()
Returns:
Return population.
Since:
v0.3

setLastIndex

protected void setLastIndex(int lastIndex)
Parameters:
lastIndex - the lastIndex to set

setPopulation

protected void setPopulation(IPopulation population)
Parameters:
population - the population to set
Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02