net.sourceforge.cilib.moo.archive.constrained
Class SetBasedConstrainedArchive

java.lang.Object
  extended by net.sourceforge.cilib.moo.archive.Archive
      extended by net.sourceforge.cilib.moo.archive.constrained.ConstrainedArchive
          extended by net.sourceforge.cilib.moo.archive.constrained.SetBasedConstrainedArchive
All Implemented Interfaces:
Iterable<OptimisationSolution>, Collection<OptimisationSolution>, List<OptimisationSolution>

public class SetBasedConstrainedArchive
extends ConstrainedArchive

A constrained set-driven Archive implementation. It makes use of a Selection to determine which solution from the archive will be selected next for removal if the archive grows larger than the capacity.

Author:
Wiehann Matthysen

Constructor Summary
SetBasedConstrainedArchive()
           
 
Method Summary
 void add(int index, OptimisationSolution element)
           
 boolean addAll(int index, Collection<? extends OptimisationSolution> c)
           
 boolean addToStructure(OptimisationSolution optimisationSolution)
          Adds a non-dominated candidateSolution into the archive.
 void clear()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection<?> objects)
           
 Collection<OptimisationSolution> dominates(OptimisationSolution candidateSolution)
          Checks the entire archive and accumulates the solutions that dominates candidateSolution.
 OptimisationSolution get(int index)
           
 SelectionRecipe<OptimisationSolution> getPruningSelection()
           
 int indexOf(Object o)
           
 Collection<OptimisationSolution> isDominatedBy(OptimisationSolution candidateSolution)
          Checks the archive and accumulates all solutions that is dominated by candidateSolution.
 boolean isEmpty()
           
 Iterator<OptimisationSolution> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<OptimisationSolution> listIterator()
           
 ListIterator<OptimisationSolution> listIterator(int index)
           
protected  void prune()
          This method needs to be implemented by all subclasses to provide a way in which certain solutions will be removed if the archive grows too big.
 OptimisationSolution remove(int index)
           
 boolean remove(Object object)
           
 boolean removeAll(Collection<?> objects)
           
 boolean retainAll(Collection<?> objects)
           
 OptimisationSolution set(int index, OptimisationSolution element)
           
 void setPruningSelection(SelectionRecipe<OptimisationSolution> pruningSelection)
           
 int size()
           
 List<OptimisationSolution> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class net.sourceforge.cilib.moo.archive.constrained.ConstrainedArchive
add, addAll, addNonDominatedSolution, getCapacity, setCapacity
 
Methods inherited from class net.sourceforge.cilib.moo.archive.Archive
get, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

SetBasedConstrainedArchive

public SetBasedConstrainedArchive()
Method Detail

setPruningSelection

public void setPruningSelection(SelectionRecipe<OptimisationSolution> pruningSelection)

getPruningSelection

public SelectionRecipe<OptimisationSolution> getPruningSelection()

dominates

public Collection<OptimisationSolution> dominates(OptimisationSolution candidateSolution)
Description copied from class: Archive
Checks the entire archive and accumulates the solutions that dominates candidateSolution.

Specified by:
dominates in class Archive
Parameters:
candidateSolution - The solution to compare against all of the solutions in the archive.
Returns:
The collection of solutions that dominates candidateSolution.

isDominatedBy

public Collection<OptimisationSolution> isDominatedBy(OptimisationSolution candidateSolution)
Description copied from class: Archive
Checks the archive and accumulates all solutions that is dominated by candidateSolution.

Specified by:
isDominatedBy in class Archive
Parameters:
candidateSolution - The solution to compare against all of the solutions in the archive.
Returns:
The collection of solutions dominated by the candidateSolution.

prune

protected void prune()
Description copied from class: ConstrainedArchive
This method needs to be implemented by all subclasses to provide a way in which certain solutions will be removed if the archive grows too big.

Specified by:
prune in class ConstrainedArchive

addToStructure

public boolean addToStructure(OptimisationSolution optimisationSolution)
Description copied from class: ConstrainedArchive
Adds a non-dominated candidateSolution into the archive.

Specified by:
addToStructure in class ConstrainedArchive
Parameters:
optimisationSolution - The non-dominated solution to add to the archive.

clear

public void clear()

contains

public boolean contains(Object object)

containsAll

public boolean containsAll(Collection<?> objects)

isEmpty

public boolean isEmpty()

iterator

public Iterator<OptimisationSolution> iterator()

remove

public boolean remove(Object object)

removeAll

public boolean removeAll(Collection<?> objects)

retainAll

public boolean retainAll(Collection<?> objects)

size

public int size()

toArray

public Object[] toArray()

toArray

public <T> T[] toArray(T[] a)

addAll

public boolean addAll(int index,
                      Collection<? extends OptimisationSolution> c)

get

public OptimisationSolution get(int index)

set

public OptimisationSolution set(int index,
                                OptimisationSolution element)

add

public void add(int index,
                OptimisationSolution element)

remove

public OptimisationSolution remove(int index)

indexOf

public int indexOf(Object o)

lastIndexOf

public int lastIndexOf(Object o)

listIterator

public ListIterator<OptimisationSolution> listIterator()

listIterator

public ListIterator<OptimisationSolution> listIterator(int index)

subList

public List<OptimisationSolution> subList(int fromIndex,
                                          int toIndex)


Copyright © 2009 CIRG. All Rights Reserved.