|
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.SortedPopulation
Base class for a population.
Field Summary | |
protected IndividualComparator |
comp
Individual comparator used for comparison of individuals. |
protected SortedVector |
pop
Sorted vector 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 | |
SortedPopulation()
Default constructor. |
|
SortedPopulation(IndividualComparator comp)
Constructor with individual comparator. |
|
SortedPopulation(IndividualComparator comp,
IndividualFilter filt)
Constructor with individual comparator and filter. |
Method Summary | |
void |
add(Individual i)
Adds an individual. |
void |
add(Individual[] ia)
Adds an array with individuals to the population. |
void |
add(java.util.Vector iv)
Deprecated. should not be used any longer |
Individual |
get(int i)
Gets the individual at a particular index. |
Individual |
getAverage()
Gets an average individual from this population. |
Individual |
getBest()
Gets the best individual from this population. |
IndividualComparator |
getComparator()
Gets the individual comparator. |
int |
getIndex(Individual i)
Gets the index of a particular individual. |
Individual |
getWorst()
Gets the worst individual from this population. |
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. |
void |
setComparator(IndividualComparator comp)
Sets a new individual comparator. |
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. |
Individual[] |
toArray()
Gets a copy of the internal array with all individuals. |
java.util.Collection |
toCollection()
Gets a all individuals of the population contained in an array list. |
Methods inherited from class mss.ea.core.AbstractPopulation |
add, add, getCounter, getFilter, getStream, notificationSignal, setFilter, 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 IndividualComparator comp
protected SortedVector pop
Constructor Detail |
public SortedPopulation()
public SortedPopulation(IndividualComparator comp)
comp
- individual comparatorpublic SortedPopulation(IndividualComparator comp, IndividualFilter filt)
comp
- individual comparatorfilter
- individual filterMethod 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 void add(java.util.Vector iv)
iv
- vector with individualspublic Individual get(int i)
get
in class AbstractPopulation
i
- position of the individualpublic Individual getBest()
public Individual getAverage()
public Individual getWorst()
public int getIndex(Individual i)
i
- individualpublic Individual[] toArray()
toArray
in class AbstractPopulation
public java.util.Collection toCollection()
toCollection
in class AbstractPopulation
public 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 removeAll()
removeAll
in class AbstractPopulation
public void remove(int lowerIndex, int upperIndex)
remove
in class AbstractPopulation
lowerIndex
- lower boundupperIndex
- upper boundpublic IndividualComparator getComparator()
public void setComparator(IndividualComparator comp)
comp
- new individual comparatorpublic 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 |