com.neatech.climbplan.activityplanner
Class AStarSearchAlgorithm

java.lang.Object
  extended by com.neatech.climbplan.activityplanner.SearchAlgorithm
      extended by com.neatech.climbplan.activityplanner.AStarSearchAlgorithm

public class AStarSearchAlgorithm
extends SearchAlgorithm


Field Summary
private  PriorityQueue<Node> fringe
           
private static int INITIAL_QUEUE_CAPACITY
           
private  double progress
           
 
Fields inherited from class com.neatech.climbplan.activityplanner.SearchAlgorithm
closedList, startNode
 
Constructor Summary
AStarSearchAlgorithm()
           
 
Method Summary
protected  boolean empty()
           
protected  void insert(Node node)
          Inserts a node into the fringe
protected  void insertAll(List<Node> nodes)
          Inserts a set of nodes into the fringe
protected  boolean isClosed(Node node)
           
 double progress()
          Returns the progress of the algorithm.
protected  Node removeFirst()
           
protected  void reset()
          Resets the algorithm by clearing the state
protected  void visit(Node node)
          Called when the node is visited by the algorithm
protected  void writePath(Node node)
           
 
Methods inherited from class com.neatech.climbplan.activityplanner.SearchAlgorithm
addChangeListener, notifyChangeListeners, removeChangeListener, search, solution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_QUEUE_CAPACITY

private static final int INITIAL_QUEUE_CAPACITY
See Also:
Constant Field Values

fringe

private PriorityQueue<Node> fringe

progress

private double progress
Constructor Detail

AStarSearchAlgorithm

public AStarSearchAlgorithm()
Method Detail

reset

protected void reset()
Description copied from class: SearchAlgorithm
Resets the algorithm by clearing the state

Specified by:
reset in class SearchAlgorithm

empty

protected boolean empty()
Specified by:
empty in class SearchAlgorithm
Returns:
true if there are no more elements in the fringe

removeFirst

protected Node removeFirst()
Specified by:
removeFirst in class SearchAlgorithm
Returns:
the first element of the fringe

insert

protected void insert(Node node)
Description copied from class: SearchAlgorithm
Inserts a node into the fringe

Specified by:
insert in class SearchAlgorithm
Parameters:
node - to be inserted

insertAll

protected void insertAll(List<Node> nodes)
Description copied from class: SearchAlgorithm
Inserts a set of nodes into the fringe

Specified by:
insertAll in class SearchAlgorithm
Parameters:
nodes - to be inserted

visit

protected void visit(Node node)
Description copied from class: SearchAlgorithm
Called when the node is visited by the algorithm

Specified by:
visit in class SearchAlgorithm
Parameters:
node - to be visited

isClosed

protected boolean isClosed(Node node)
Specified by:
isClosed in class SearchAlgorithm
Parameters:
node - is checked whether it is closed or not
Returns:
true if the node is closed

progress

public double progress()
Description copied from class: SearchAlgorithm
Returns the progress of the algorithm.

Specified by:
progress in class SearchAlgorithm
Returns:
a value in the range [0.0,1.0] indicating the current progress of the algorithm

writePath

protected void writePath(Node node)