com.neatech.climbplan.activityplanner
Class Node

java.lang.Object
  extended by com.neatech.climbplan.activityplanner.Node
All Implemented Interfaces:
Comparable<Node>

public class Node
extends Object
implements Comparable<Node>


Field Summary
private  int action
          the action that was applied to the parent to generate the node
private  int depth
          the number of steps along the path from the initial state
static int GO_EAST
           
static int GO_NORTH
           
static int GO_NORTH_EAST
           
static int GO_NORTH_WEST
           
static int GO_SOUTH
           
static int GO_SOUTH_EAST
           
static int GO_SOUTH_WEST
           
static int GO_WEST
           
private  int id
          used to uniquely identify nodes
static int NO_ACTION
           
private  Node parentNode
          the node in the search tree that generated this node
private  double pathCost
          the cost, traditionally denoted by g(n), of the path from the initial state to the node, as indicated by the parent pointers
private  State state
          the state in the state space to which the node corresponds
 
Constructor Summary
Node(State state, Node parentNode, int action, double pathCost, int depth)
           
 
Method Summary
 int compareTo(Node o)
           
 boolean equals(Object o)
           
 double evaluationFunction()
           
 List<Node> expand()
           
 int getAction()
           
 int getDepth()
           
 int getID()
           
 Node getParent()
           
 double getPathCost()
           
 State getState()
           
 int hashCode()
           
 boolean isTarget()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ACTION

public static final int NO_ACTION
See Also:
Constant Field Values

GO_NORTH_WEST

public static final int GO_NORTH_WEST
See Also:
Constant Field Values

GO_NORTH

public static final int GO_NORTH
See Also:
Constant Field Values

GO_NORTH_EAST

public static final int GO_NORTH_EAST
See Also:
Constant Field Values

GO_EAST

public static final int GO_EAST
See Also:
Constant Field Values

GO_SOUTH_EAST

public static final int GO_SOUTH_EAST
See Also:
Constant Field Values

GO_SOUTH

public static final int GO_SOUTH
See Also:
Constant Field Values

GO_SOUTH_WEST

public static final int GO_SOUTH_WEST
See Also:
Constant Field Values

GO_WEST

public static final int GO_WEST
See Also:
Constant Field Values

id

private int id
used to uniquely identify nodes


state

private State state
the state in the state space to which the node corresponds


parentNode

private Node parentNode
the node in the search tree that generated this node


action

private int action
the action that was applied to the parent to generate the node


pathCost

private double pathCost
the cost, traditionally denoted by g(n), of the path from the initial state to the node, as indicated by the parent pointers


depth

private int depth
the number of steps along the path from the initial state

Constructor Detail

Node

public Node(State state,
            Node parentNode,
            int action,
            double pathCost,
            int depth)
Method Detail

getID

public int getID()

getState

public State getState()

getParent

public Node getParent()

getAction

public int getAction()

getPathCost

public double getPathCost()

getDepth

public int getDepth()

isTarget

public boolean isTarget()
Returns:
true if the node is a target node

evaluationFunction

public double evaluationFunction()

expand

public List<Node> expand()

compareTo

public int compareTo(Node o)
Specified by:
compareTo in interface Comparable<Node>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object