public abstract class BoundedArchive extends AbstractArchive
Archive
with bounded size.Modifier and Type | Field and Description |
---|---|
protected int |
capacity
The capacity of this
Archive |
individuals, listeners
Constructor and Description |
---|
BoundedArchive(int capacity)
Constructs a bounded archive with the specified capacity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCheckedIndividual(Individual individual)
Adds the
Individual to this Archive without further
checks. |
boolean |
addCheckedIndividuals(java.util.Collection<? extends Individual> c)
Adds the
Individual s to this Archive without further
checks. |
int |
getCapacity()
Returns the capacity of this
BoundedArchive . |
void |
setCapacity(int capacity)
Sets the capacity of this
BoundedArchive . |
update, updateWithNondominated
add, addAll, addAll, addListener, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeListener, retainAll, size, toArray, toArray
protected int capacity
Archive
@Inject public BoundedArchive(int capacity)
capacity
- Capacity of this archivepublic void setCapacity(int capacity)
BoundedArchive
.capacity
- new capacity of this bounded archivegetCapacity()
public int getCapacity()
BoundedArchive
.setCapacity(int)
public boolean addCheckedIndividual(Individual individual)
Archive
Individual
to this Archive
without further
checks. Must be used only if the Individual
is checked to be
Pareto-dominant and, according to possible archive size restrictions, can
be added to this Archive
.addCheckedIndividual
in class Archive
individual
- the individual to be actually added to the archivejava.lang.IndexOutOfBoundsException
- if the capacity is reached.public boolean addCheckedIndividuals(java.util.Collection<? extends Individual> c)
Archive
Individual
s to this Archive
without further
checks. Must be used only if the Individual
s are checked to be
Pareto-dominant and, according to possible archive size restrictions, can
all be added to this Archive
.addCheckedIndividuals
in class Archive
c
- the individuals to be actually added to the archivejava.lang.IndexOutOfBoundsException
- if the capacity is reached.