AlgorithmTest
Class Node

java.lang.Object
  extended by AlgorithmTest.Node
All Implemented Interfaces:
java.lang.Comparable

public class Node
extends java.lang.Object
implements java.lang.Comparable

This is one node of the scene.


Field Summary
static int CLOSED_LIST
          The Node is in the closed list
 int cost
          The cost of entering this tile
static int COST_HARD
           
static int COST_IMPOSSIBLE
           
static int COST_MEDIUM
           
static int COST_NONE
           
 int f
          The cost of traversing from start to this node
static int FINAL_PATH
          The Node is part of the final path
 int g
          The actual cheapest cost of arriving at this node from the start
 int h
          The heuristic estimate of the cost from this node to the goal
 int list
          The list this node is currently in
static int NO_LIST
          The Node is in no pathfinding - list
static int OPEN_LIST
          The Node is in the open list
 Node parent
          The parent node.
 int posX
          The x position of the node
 int posY
          The y position of the node
 
Constructor Summary
Node(int x, int y)
           
 
Method Summary
 int calcCost(Node next)
          Calculates the cost of going from this node to the other node It is presumed that both are neighbouring nodes.
 int compareTo(java.lang.Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_LIST

public static final int NO_LIST
The Node is in no pathfinding - list

See Also:
Constant Field Values

OPEN_LIST

public static final int OPEN_LIST
The Node is in the open list

See Also:
Constant Field Values

CLOSED_LIST

public static final int CLOSED_LIST
The Node is in the closed list

See Also:
Constant Field Values

FINAL_PATH

public static final int FINAL_PATH
The Node is part of the final path

See Also:
Constant Field Values

COST_NONE

public static final int COST_NONE
See Also:
Constant Field Values

COST_MEDIUM

public static final int COST_MEDIUM
See Also:
Constant Field Values

COST_HARD

public static final int COST_HARD
See Also:
Constant Field Values

COST_IMPOSSIBLE

public static final int COST_IMPOSSIBLE
See Also:
Constant Field Values

posX

public int posX
The x position of the node


posY

public int posY
The y position of the node


cost

public int cost
The cost of entering this tile


list

public int list
The list this node is currently in


f

public int f
The cost of traversing from start to this node


g

public int g
The actual cheapest cost of arriving at this node from the start


h

public int h
The heuristic estimate of the cost from this node to the goal


parent

public Node parent
The parent node. When the finish Node has been reached, go back along this Node to get the complete path

Constructor Detail

Node

public Node(int x,
            int y)
Method Detail

calcCost

public int calcCost(Node next)
Calculates the cost of going from this node to the other node It is presumed that both are neighbouring nodes.


compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable