public class AdaptiveGridArchive extends BoundedArchive
AdaptiveGridArchive
uses an adaptive grid in order to bound the
size of the Archive
, see "Properties of an Adaptive Archiving
Algorithm for Storing Nondominated Vectors, J. Knowles, D. Corne,
Transactions of Evolutionary Computation, Vol. 7, No. 2, April 2003".Modifier and Type | Class and Description |
---|---|
protected static class |
AdaptiveGridArchive.Cell
A single
AdaptiveGridArchive.Cell of the grid. |
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Long,AdaptiveGridArchive.Cell> |
cells |
protected int |
dim |
protected int |
div |
protected java.util.List<Individual> |
extrema |
protected boolean |
isInit |
protected double[] |
lb |
protected Rand |
random |
protected double[] |
ub |
capacity
individuals, listeners
Constructor and Description |
---|
AdaptiveGridArchive(int capacity,
int div,
Rand random)
Constructs an
AdaptiveGridArchive . |
Modifier and Type | Method and Description |
---|---|
protected void |
addToCell(java.lang.Iterable<Individual> individuals)
Adds all
Individual s to theirs AdaptiveGridArchive.Cell s and the AdaptiveGridArchive.Cell
s to the Archive . |
protected boolean |
determineBounds(java.util.Collection<Individual> individuals)
Determines the new bounds for the individuals and returns
true if
the bounds have changed. |
protected AdaptiveGridArchive.Cell |
getCell(Individual individual)
Returns the appropriate
AdaptiveGridArchive.Cell for the given Individual . |
protected AdaptiveGridArchive.Cell |
getMostCrowdedCell()
Returns the most crowded
AdaptiveGridArchive.Cell . |
protected void |
init(Individual individual)
Initialize the
Archive . |
boolean |
remove(java.lang.Object o) |
protected void |
removeFromCell(Individual individual)
Removes this
Individual from its AdaptiveGridArchive.Cell and removes the
AdaptiveGridArchive.Cell from the Archive if it is
empty. |
protected boolean |
updateWithNondominated(java.util.Collection<Individual> candidates)
Adds new
candidates which are already checked to be not
Pareto-dominated by any other individual in this Archive . |
addCheckedIndividual, addCheckedIndividuals, getCapacity, setCapacity
update
add, addAll, addAll, addListener, clear, contains, containsAll, isEmpty, iterator, removeAll, removeListener, retainAll, size, toArray, toArray
protected boolean isInit
protected final int div
protected final Rand random
protected final java.util.Map<java.lang.Long,AdaptiveGridArchive.Cell> cells
protected final java.util.List<Individual> extrema
protected double[] lb
protected double[] ub
protected int dim
@Inject public AdaptiveGridArchive(int capacity, int div, Rand random)
AdaptiveGridArchive
.capacity
- the capacitydiv
- the divisionsrandom
- the random number generatorprotected boolean updateWithNondominated(java.util.Collection<Individual> candidates)
AbstractArchive
candidates
which are already checked to be not
Pareto-dominated by any other individual in this Archive
. All
Individual
s in the Archive
which were dominated by the
candidates have already been removed.updateWithNondominated
in class AbstractArchive
candidates
- the non-dominated individuals which can be addedprotected void init(Individual individual)
Archive
.individual
- one random individualprotected AdaptiveGridArchive.Cell getCell(Individual individual)
AdaptiveGridArchive.Cell
for the given Individual
.individual
- the individualprotected AdaptiveGridArchive.Cell getMostCrowdedCell()
AdaptiveGridArchive.Cell
.public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<Individual>
remove
in interface java.util.Set<Individual>
remove
in class IndividualSet
protected void addToCell(java.lang.Iterable<Individual> individuals)
Individual
s to theirs AdaptiveGridArchive.Cell
s and the AdaptiveGridArchive.Cell
s to the Archive
.individuals
- the individuals to be addedprotected void removeFromCell(Individual individual)
Individual
from its AdaptiveGridArchive.Cell
and removes the
AdaptiveGridArchive.Cell
from the Archive
if it is
empty.individual
- the individual to be removedprotected boolean determineBounds(java.util.Collection<Individual> individuals)
true
if
the bounds have changed.individuals
- the individualstrue
if the bounds have changed