Class BoundedArchive

All Implemented Interfaces:
Iterable<Individual>, Collection<Individual>, Set<Individual>
Direct Known Subclasses:
AdaptiveGridArchive, CrowdingArchive

public abstract class BoundedArchive extends AbstractArchive
An Archive with bounded size.
  • Field Details

    • capacity

      protected int capacity
      The capacity of this Archive
  • Constructor Details

    • BoundedArchive

      @Inject public BoundedArchive(int capacity)
      Constructs a bounded archive with the specified capacity.
      Parameters:
      capacity - Capacity of this archive
  • Method Details

    • setCapacity

      public void setCapacity(int capacity)
      Sets the capacity of this BoundedArchive.
      Parameters:
      capacity - new capacity of this bounded archive
      See Also:
    • getCapacity

      public int getCapacity()
      Returns the capacity of this BoundedArchive.
      Returns:
      capacity of this bounded archive
      See Also:
    • addCheckedIndividual

      public boolean addCheckedIndividual(Individual individual)
      Description copied from class: Archive
      Adds the 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.
      Overrides:
      addCheckedIndividual in class Archive
      Parameters:
      individual - the individual to be actually added to the archive
      Returns:
      true
      Throws:
      IndexOutOfBoundsException - if the capacity is reached.
    • addCheckedIndividuals

      public boolean addCheckedIndividuals(Collection<? extends Individual> c)
      Description copied from class: Archive
      Adds the Individuals to this Archive without further checks. Must be used only if the Individuals are checked to be Pareto-dominant and, according to possible archive size restrictions, can all be added to this Archive.
      Overrides:
      addCheckedIndividuals in class Archive
      Parameters:
      c - the individuals to be actually added to the archive
      Returns:
      true
      Throws:
      IndexOutOfBoundsException - if the capacity is reached.