|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.Search<T>
core.DirectedSearch<T>
basic.SlowDepthFirstSearch<T>
T
- the specific type of all elements in the search domain.public class SlowDepthFirstSearch<T>
A slow implementation of the depth first search algorithm which uses the general search algorithm
implemented in the core.DirectedSearch. This depth first search algorithm is a blind search
able to solve any problem implementing the core.Problem interface.
Note: This implementation is only for completeness and should not be used.
Use the basic.DepthFirstSearch whenever you need to use a depth first search.
DepthFirstSearch
Field Summary |
---|
Fields inherited from class core.DirectedSearch |
---|
hash, problem |
Fields inherited from class core.Search |
---|
neededSteps, result |
Constructor Summary | |
---|---|
SlowDepthFirstSearch(Problem<T> problem)
This method creates a new BreadthFirstSearch where implicit duplicate duplicate handling is enabled. |
|
SlowDepthFirstSearch(Problem<T> problem,
boolean noHash)
This method creates a new SlowDepthFirstSearch. |
Method Summary | |
---|---|
protected boolean |
add(T state)
This method is the hook for adding new states to the queue during the search. |
protected void |
clear()
This method is the hook for clearing the queue on preparation of a new search. |
protected boolean |
empty()
This method is the hook for the check if the queue is empty during the search. |
protected T |
pop()
This method is the hook for extracting the first element of the queue during the search. |
Methods inherited from class core.DirectedSearch |
---|
branchedNodes, canPrepare, finalize, getProblem, prepare, search |
Methods inherited from class core.Search |
---|
getResult, initialize, initialized, neededSteps, run, running, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SlowDepthFirstSearch(Problem<T> problem)
problem
- public SlowDepthFirstSearch(Problem<T> problem, boolean noHash)
problem
- to be solvednoHash
- flag indicating that duplicates should not be handledMethod Detail |
---|
protected boolean add(T state)
DirectedSearch
add
in class DirectedSearch<T>
state
- to be added to the queue
DirectedSearch.add(java.lang.Object)
protected void clear()
DirectedSearch
clear
in class DirectedSearch<T>
DirectedSearch.clear()
protected boolean empty()
DirectedSearch
empty
in class DirectedSearch<T>
DirectedSearch.empty()
protected T pop()
DirectedSearch
pop
in class DirectedSearch<T>
DirectedSearch.pop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |