|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mss.ea.core.GeneticOperator | +--mss.ea.core.AbstractPopulation
Abstract base class for a population. This class provides some common methods for a population. Most of the implemented methods should be overloaded due to performance reasons.
Field Summary | |
protected IndividualFilter |
filter
Individual filter for insertion of individuals into this population. |
protected LongCounter |
gc
Generation counter. |
Fields inherited from class mss.ea.core.GeneticOperator |
description, ID, name |
Constructor Summary | |
AbstractPopulation()
Default constructor. |
|
AbstractPopulation(IndividualFilter filt)
Constructor with individual filter. |
Method Summary | |
void |
add(java.util.Collection ic)
Adds a collection of individuals to this population. |
abstract void |
add(Individual i)
Adds an individual. |
void |
add(Individual[] ia)
Adds an array with individuals to this population. |
void |
add(IndividualStream is)
Adds a stream of individuals to this population. |
abstract Individual |
get(int i)
Gets the individual at a particular index. |
LongCounter |
getCounter()
Gets the generation counter. |
IndividualFilter |
getFilter()
Gets the reinsertion filter. |
IndividualStream |
getStream()
Deprecated. replaced by toStream() |
void |
notificationSignal()
Cycle notification. |
abstract void |
remove(int i)
Removes an individual from the population. |
void |
remove(int lowerIndex,
int upperIndex)
Removes a range of individuals. |
void |
removeAll()
Removes all individuals. |
abstract void |
replace(Individual i,
int index)
Replaces an individual at a particular position. |
void |
setFilter(IndividualFilter filter)
Sets a new reinsertion operator. |
abstract int |
size()
Gets the current size of the population. |
Individual[] |
toArray()
Gets a copy of the internal buffer with all individuals. |
java.util.Collection |
toCollection()
Gets a all individuals of the population contained in an arraylist. |
IndividualStream |
toStream()
Returns all individuals as an array stream. |
Methods inherited from class mss.ea.core.GeneticOperator |
getDescription, getID, getName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected LongCounter gc
protected IndividualFilter filter
Constructor Detail |
public AbstractPopulation()
public AbstractPopulation(IndividualFilter filt)
filt
- individual filter for this populationMethod Detail |
public void notificationSignal()
notificationSignal
in interface NotificationListener
public abstract int size()
size
in interface IndividualGate
public abstract void add(Individual i)
add
in interface IndividualGate
i
- individual to addpublic void add(Individual[] ia)
add
in interface IndividualGate
ia
- array with individualspublic void add(java.util.Collection ic)
ic
- collection with individualspublic void add(IndividualStream is)
add
in interface IndividualGate
is
- stream with individualspublic abstract Individual get(int i)
get
in interface IndividualGate
i
- position of the individualpublic Individual[] toArray()
toArray
in interface IndividualGate
public java.util.Collection toCollection()
public IndividualStream getStream()
getStream
in interface IndividualGate
public IndividualStream toStream()
toStream
in interface IndividualGate
public abstract void replace(Individual i, int index)
i
- new individualindex
- position of the individual to replacepublic abstract void remove(int i)
remove
in interface IndividualGate
i
- position of the individualpublic void remove(int lowerIndex, int upperIndex)
remove
in interface IndividualGate
lowerIndex
- lower boundupperIndex
- upper boundpublic void removeAll()
removeAll
in interface IndividualGate
public LongCounter getCounter()
public void setFilter(IndividualFilter filter)
filter
- new reinsertion operatorpublic IndividualFilter getFilter()
|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |