|
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 | +--mss.ea.core.GenericPopulation
Generic implementation of a population. The individuals in this population are unsorted.
Field Summary | |
protected java.util.ArrayList |
pop
ArrayList with individuals, which represents the population. |
Fields inherited from class mss.ea.core.AbstractPopulation |
filter, gc |
Fields inherited from class mss.ea.core.GeneticOperator |
description, ID, name |
Constructor Summary | |
GenericPopulation()
Default constructor. |
|
GenericPopulation(IndividualFilter filt)
Constructor with individual filter. |
Method Summary | |
void |
add(Individual i)
Adds an individual. |
void |
add(Individual[] ia)
Adds an array with individuals to the population. |
Individual |
get(int i)
Gets the individual at a particular index. |
int |
getIndex(Individual i)
Gets the index of a particular individual. |
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. |
void |
replace(Individual i,
int index)
Replaces an individual at a position. |
int |
size()
Gets the current size of the population. |
java.util.List |
subList(int fromIndex,
int toIndex)
Gets a part of the population as a list. |
Methods inherited from class mss.ea.core.AbstractPopulation |
add, add, getCounter, getFilter, getStream, notificationSignal, setFilter, toArray, toCollection, toStream |
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 java.util.ArrayList pop
Constructor Detail |
public GenericPopulation()
public GenericPopulation(IndividualFilter filt)
filt
- individual filter used for insertionMethod Detail |
public int size()
size
in class AbstractPopulation
public void add(Individual i)
add
in class AbstractPopulation
i
- individual to addpublic void add(Individual[] ia)
add
in class AbstractPopulation
ia
- array with individualspublic Individual get(int i)
get
in class AbstractPopulation
i
- position of the individualpublic int getIndex(Individual i)
i
- individualpublic void replace(Individual i, int index)
replace
in class AbstractPopulation
i
- new individualindex
- position of the individual to replacepublic void remove(int i)
remove
in class AbstractPopulation
i
- position of the individualpublic void remove(int lowerIndex, int upperIndex)
remove
in class AbstractPopulation
lowerIndex
- lower boundupperIndex
- upper boundpublic void removeAll()
removeAll
in class AbstractPopulation
public java.util.List subList(int fromIndex, int toIndex)
fromIndex
- lower indextoIndex
- upper index
|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |