Package org.opt4j.core.optimizer
Class Archive
java.lang.Object
org.opt4j.core.IndividualSet
org.opt4j.core.optimizer.Archive
- All Implemented Interfaces:
Iterable<Individual>,Collection<Individual>,Set<Individual>
- Direct Known Subclasses:
AbstractArchive
An
Archive is used to store a set of high-quality Individual
s. Commonly, these Individuals are non-dominated.-
Field Summary
Fields inherited from class org.opt4j.core.IndividualSet
individuals, listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanadd(Individual individual) Deprecated.final booleanaddAll(Collection<? extends Individual> c) Deprecated.final booleanaddAll(Individual... c) Deprecated.protected booleanaddCheckedIndividual(Individual individual) Adds theIndividualto thisArchivewithout further checks.protected booleanaddCheckedIndividuals(Collection<? extends Individual> individuals) Adds theIndividuals to thisArchivewithout further checks.abstract booleanupdate(Set<? extends Individual> individuals) Updates the archive with a set of individuals.booleanupdate(Individual individual) Updates the archive with a single individual.Methods inherited from class org.opt4j.core.IndividualSet
addListener, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeListener, retainAll, size, toArray, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Constructor Details
-
Archive
public Archive()
-
-
Method Details
-
update
Updates the archive with a single individual.- Parameters:
individual- the individual that is used to update the archive- Returns:
- returns
trueif the content of the archive changed
-
update
Updates the archive with a set of individuals. Instead of theadd/addAllmethods, which are prohibited for the archive (throwing anUnsupportedOperationException), this method shall be used.- Parameters:
individuals- the set of individuals that is used to update the archive- Returns:
- returns
trueif the content of the archive changed
-
add
Deprecated.- Specified by:
addin interfaceCollection<Individual>- Specified by:
addin interfaceSet<Individual>- Overrides:
addin classIndividualSet
-
addAll
Deprecated.- Specified by:
addAllin interfaceCollection<Individual>- Specified by:
addAllin interfaceSet<Individual>- Overrides:
addAllin classIndividualSet
-
addAll
Deprecated.Description copied from class:IndividualSetAdd allIndividuals.- Overrides:
addAllin classIndividualSet- Parameters:
c- the individuals to be added- Returns:
- true if at least one individual was added
-
addCheckedIndividual
Adds theIndividualto thisArchivewithout further checks. Must be used only if theIndividualis checked to be Pareto-dominant and, according to possible archive size restrictions, can be added to thisArchive.- Parameters:
individual- the individual to be actually added to the archive- Returns:
- true
-
addCheckedIndividuals
Adds theIndividuals to thisArchivewithout further checks. Must be used only if theIndividuals are checked to be Pareto-dominant and, according to possible archive size restrictions, can all be added to thisArchive.- Parameters:
individuals- the individuals to be actually added to the archive- Returns:
- true
-