Class BoundedArchive

    • Field Detail

      • capacity

        protected int capacity
        The capacity of this Archive
    • Constructor Detail

      • BoundedArchive

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

      • setCapacity

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

        public int getCapacity()
        Returns the capacity of this BoundedArchive.
        Returns:
        capacity of this bounded archive
        See Also:
        setCapacity(int)
      • 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.