|
Hemisson Tjerk Kostelijk & Anne Schuth <-- BACK TO CLASSES |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAStar
An implementation of the A* algoritm. It is goal directed and only returns full paths.
Constructor Summary | |
AStar()
|
Method Summary | |
static void |
fetchFamily(Node n,
Node nStart,
NodeList path)
Recursive method that fetches all the nodes, starting with the goal and following the parents. |
static int |
getManhattanDist(Node nA,
Node nB)
Calculates the manhattan-distance between two nodes |
static NodeList |
getNeighbours(NodeList world,
Node nCurrent,
Node nGoal)
Makes a NodeList holding all the neighbour Nodes using 4-connectivity. |
static NodeList |
run(NodeList world,
Node nGoal,
Node nStartInit)
The main method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AStar()
Method Detail |
public static NodeList run(NodeList world, Node nGoal, Node nStartInit)
world
- Nodelist containing a worldnGoal
- The goal node
public static void fetchFamily(Node n, Node nStart, NodeList path)
public static int getManhattanDist(Node nA, Node nB)
public static NodeList getNeighbours(NodeList world, Node nCurrent, Node nGoal)
world
- Nodelist containing a worldnCurrent
- The currentnodenGoal
- the goal node
|
Hemisson Tjerk Kostelijk & Anne Schuth <-- BACK TO CLASSES |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |