|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.neatech.climbplan.activityplanner.SearchAlgorithm
public abstract class SearchAlgorithm
| Field Summary | |
|---|---|
private List<ChangeListener> |
changeListeners
|
protected Hashtable<Integer,Node> |
closedList
|
protected Node |
startNode
|
| Constructor Summary | |
|---|---|
SearchAlgorithm()
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener changeListener)
|
private void |
constructPath(List<Node> path,
Node node)
|
protected abstract boolean |
empty()
|
protected abstract void |
insert(Node node)
Inserts a node into the fringe |
protected abstract void |
insertAll(List<Node> nodes)
Inserts a set of nodes into the fringe |
protected abstract boolean |
isClosed(Node node)
|
protected void |
notifyChangeListeners()
|
abstract double |
progress()
Returns the progress of the algorithm. |
void |
removeChangeListener(ChangeListener changeListener)
|
protected abstract Node |
removeFirst()
|
protected abstract void |
reset()
Resets the algorithm by clearing the state |
List<Node> |
search(Node startNode)
Implements the generic tree search algorithm. |
protected List<Node> |
solution(Node node)
Called when the search is complete. |
protected abstract void |
visit(Node node)
Called when the node is visited by the algorithm |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private List<ChangeListener> changeListeners
protected Hashtable<Integer,Node> closedList
protected Node startNode
| Constructor Detail |
|---|
public SearchAlgorithm()
| Method Detail |
|---|
protected abstract void reset()
protected abstract boolean empty()
protected abstract Node removeFirst()
protected abstract void insert(Node node)
node - to be insertedprotected abstract void insertAll(List<Node> nodes)
nodes - to be insertedprotected abstract void visit(Node node)
node - to be visitedprotected abstract boolean isClosed(Node node)
node - is checked whether it is closed or not
protected List<Node> solution(Node node)
node - is the target if there is a solution
otherwise null
private void constructPath(List<Node> path,
Node node)
public abstract double progress()
public List<Node> search(Node startNode)
startNode - is the initial nodeprotected void notifyChangeListeners()
public void addChangeListener(ChangeListener changeListener)
public void removeChangeListener(ChangeListener changeListener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||