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

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

public abstract class ConstrainedArchive
extends Archive

An Archive constrained by the number of solutions that it can store.

Author:
Wiehann Matthysen

Constructor Summary
ConstrainedArchive()
           
 
Method Summary
 boolean add(OptimisationSolution candidateSolution)
          Adds the candidateSolution if no solution within the archive dominates it.
 boolean addAll(Collection<? extends OptimisationSolution> candidateSolutions)
          Iterates through the collection of candidateSolutions and adds the non-dominated solutions to the archive.
protected  boolean addNonDominatedSolution(OptimisationSolution candidateSolution)
           
protected abstract  boolean addToStructure(OptimisationSolution candidateSolution)
          Adds a non-dominated candidateSolution into the archive.
 int getCapacity()
           
protected abstract  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.
 void setCapacity(int capacity)
           
 
Methods inherited from class net.sourceforge.cilib.moo.archive.Archive
dominates, get, isDominatedBy, 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
add, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Constructor Detail

ConstrainedArchive

public ConstrainedArchive()
Method Detail

setCapacity

public void setCapacity(int capacity)

getCapacity

public int getCapacity()

addAll

public final boolean addAll(Collection<? extends OptimisationSolution> candidateSolutions)
Iterates through the collection of candidateSolutions and adds the non-dominated solutions to the archive. If the archive becomes too large a pruning strategy is invoked afterwards.

Parameters:
candidateSolutions - The solutions to add to the archive.
Returns:
True if the archive changed as a result of the method call.

add

public final boolean add(OptimisationSolution candidateSolution)
Adds the candidateSolution if no solution within the archive dominates it. If the archive becomes too large a pruning strategy is invoked afterwards.

Parameters:
candidateSolution - The solution to add to the archive.
Returns:
True if the archive changed as a result if the method call.

addNonDominatedSolution

protected final boolean addNonDominatedSolution(OptimisationSolution candidateSolution)

addToStructure

protected abstract boolean addToStructure(OptimisationSolution candidateSolution)
Adds a non-dominated candidateSolution into the archive.

Parameters:
candidateSolution - The non-dominated solution to add to the archive.

prune

protected abstract 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.



Copyright © 2009 CIRG. All Rights Reserved.