|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.utils.astar.AStarResult<NODE>
public class AStarResult<NODE>
This class is returned by AStar.aStar(). It contains results from the search as well as method for finding the path from the startNode to the goalNode. It contains all data structures the AStar is using during the work. Everything is made public here so that AStar (during work) and you (for browsing the results) may use it.
Field Summary | |
---|---|
java.util.Collection<NODE> |
closeList
Nodes which were examined by the algoritm. |
java.util.HashMap<NODE,java.lang.Integer> |
estimatedCost
Used and filled by A* alorithm (AStar.aStar()). |
NODE |
goalNode
Node which was marked as a goalNode by AStarMap. |
long |
interations
Contains the number of iterations made by A* search. |
java.util.Collection<NODE> |
openList
List of nodes which is opened -> was touched by the algorithm and are subjects of examination. |
java.util.HashMap<NODE,java.lang.Integer> |
pathCost
Used and filled by A* algorithm (AStar.aStar()). |
java.util.HashMap<NODE,NODE> |
previousNode
Used by getPath() and filled by A* algorithm (AStar.aStar()). |
NODE |
startNode
Start node of the A*. |
boolean |
success
Wether goalNode was found during the A* run. |
Constructor Summary | |
---|---|
AStarResult()
|
Method Summary | |
---|---|
int |
getCostToNode(NODE node)
Returns cost of the path from startNode to node if the node was touched by A* algorithm (if A* was successful, then this always contains the goalNode and every node on the path). |
int |
getDistanceToGoal()
If the AStar succeeded then it returns the distance to the goal. |
int |
getEstimatedCostToNode(NODE node)
Returns estimated cost of the path from startNode to goal through node. |
java.util.List<NODE> |
getPath()
Returns the path from startNode to goalNode. |
NODE |
getPreviousNode(NODE node)
Used by getPath() method when creating a list of nodes (the path) from startNode to goalNode. |
void |
putCostToNode(NODE node,
java.lang.Integer cost)
Assing cost of the path from startNode to node. |
void |
putEstimatedCostToNode(NODE node,
java.lang.Integer cost)
Assing estimated cost of the path from startNode to goalNode through node. |
void |
putPreviousNode(NODE node,
NODE previous)
Assing 'previous' as an previous node for 'node' (the path from 'startNode' to 'node' goes across 'previous'). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.HashMap<NODE,NODE> previousNode
public java.util.Collection<NODE> openList
public java.util.Collection<NODE> closeList
public java.util.HashMap<NODE,java.lang.Integer> pathCost
public java.util.HashMap<NODE,java.lang.Integer> estimatedCost
public long interations
public NODE startNode
public NODE goalNode
public boolean success
Constructor Detail |
---|
public AStarResult()
Method Detail |
---|
public NODE getPreviousNode(NODE node)
node
-
public void putPreviousNode(NODE node, NODE previous)
node
- previous
- public int getCostToNode(NODE node)
node
-
public void putCostToNode(NODE node, java.lang.Integer cost)
node
- cost
- public int getEstimatedCostToNode(NODE node)
node
-
public void putEstimatedCostToNode(NODE node, java.lang.Integer cost)
node
- cost
- public java.util.List<NODE> getPath()
public int getDistanceToGoal()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |