org.browsecode.helpers.aisearch
Class AISearchDomainStub<N>

java.lang.Object
  extended by org.browsecode.helpers.aisearch.AISearchDomainStub<N>
All Implemented Interfaces:
AISearchDomain<N>

public abstract class AISearchDomainStub<N>
extends java.lang.Object
implements AISearchDomain<N>

This should be thread-safe, but we haven't tested it. Theoretically, you can put in several threads running through this search domain at the same time and it would not hurt.


Constructor Summary
AISearchDomainStub()
           
 
Method Summary
protected  void clearAllSolutions()
          Clear the cache and ready for the next set of solutions.
protected abstract  java.util.Comparator<Solution<N>> getBestSolutionComparator()
           
 java.util.PriorityQueue<Solution<N>> getFinishedSolutions()
           
 int getNumberOfUnexpandedSolutions()
          For debugging only, really, if you want to see the status.
protected abstract  java.util.Comparator<Solution<N>> getQuickestSearchComparator()
           
protected  N getRootNode()
           
 boolean hasUnexpandedNodes()
           
 Solution<N> popUnexpandedNode()
           
 void pushFinalSolution(SolutionStub<N> solution)
           
 void pushUnexpandedNode(SolutionStub<N> node)
           
protected  void setRootNode(N firstNode)
          Reinitializes the whole thing -- clears the cache, etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AISearchDomainStub

public AISearchDomainStub()
Method Detail

getRootNode

protected N getRootNode()

setRootNode

protected void setRootNode(N firstNode)
Reinitializes the whole thing -- clears the cache, etc. Make sure you're not using the last one when you call this and clear everything! This doesn't check.

Parameters:
firstNode -

clearAllSolutions

protected void clearAllSolutions()
Clear the cache and ready for the next set of solutions. Subclasses should call this before they pass in the first solution via pushUnexpandedNode().


getFinishedSolutions

public java.util.PriorityQueue<Solution<N>> getFinishedSolutions()
Specified by:
getFinishedSolutions in interface AISearchDomain<N>

getNumberOfUnexpandedSolutions

public int getNumberOfUnexpandedSolutions()
For debugging only, really, if you want to see the status.


hasUnexpandedNodes

public boolean hasUnexpandedNodes()
Specified by:
hasUnexpandedNodes in interface AISearchDomain<N>

pushFinalSolution

public void pushFinalSolution(SolutionStub<N> solution)

popUnexpandedNode

public Solution<N> popUnexpandedNode()
Specified by:
popUnexpandedNode in interface AISearchDomain<N>

pushUnexpandedNode

public void pushUnexpandedNode(SolutionStub<N> node)

getBestSolutionComparator

protected abstract java.util.Comparator<Solution<N>> getBestSolutionComparator()

getQuickestSearchComparator

protected abstract java.util.Comparator<Solution<N>> getQuickestSearchComparator()