com.neatech.climbplan.activityplanner
Class AStarSearchAlgorithm
java.lang.Object
com.neatech.climbplan.activityplanner.SearchAlgorithm
com.neatech.climbplan.activityplanner.AStarSearchAlgorithm
public class AStarSearchAlgorithm
- extends SearchAlgorithm
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INITIAL_QUEUE_CAPACITY
private static final int INITIAL_QUEUE_CAPACITY
- See Also:
- Constant Field Values
fringe
private PriorityQueue<Node> fringe
progress
private double progress
AStarSearchAlgorithm
public AStarSearchAlgorithm()
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)