ai.search
Class Node

java.lang.Object
  extended byai.search.Node

public class Node
extends java.lang.Object

A node in a search problem.

Author:
Jill Zimmerman -- jill.zimmerman@goucher.edu

Field Summary
 java.lang.Object action
          The domain action leading to the state.
 int depth
          The depth of the node in the tree (root = 0).
 int fCost
          gCost + hCost.
 int gCost
          The path cost from root to node.
 int hCost
          Estimated distance from state to goal.
 Node parent
          The parent Node.
 java.lang.Object state
          A state in the domain.
 java.util.Vector successors
          A list of successor Nodes.
 
Method Summary
 java.util.Vector expand(Problem problem)
          Generate a list of all the nodes that can be reached from a node.
 java.util.Vector solutionActions()
          Generate a list of actions that reach a solution.
 java.util.Vector solutionNodes()
          Generate a list of nodes that reach a solution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

public java.lang.Object state
A state in the domain.


parent

public Node parent
The parent Node.


action

public java.lang.Object action
The domain action leading to the state.


successors

public java.util.Vector successors
A list of successor Nodes.


depth

public int depth
The depth of the node in the tree (root = 0).


gCost

public int gCost
The path cost from root to node.


hCost

public int hCost
Estimated distance from state to goal.


fCost

public int fCost
gCost + hCost.

Method Detail

expand

public java.util.Vector expand(Problem problem)
Generate a list of all the nodes that can be reached from a node. Note: the problem's successor method returns a list of (action . state) pairs. This function turns each of these into a node.

Parameters:
problem - is a search problem
Returns:
the list of nodes that can be reached from this node.

solutionActions

public java.util.Vector solutionActions()
Generate a list of actions that reach a solution.

Returns:
the list of actions that reach a solution.

solutionNodes

public java.util.Vector solutionNodes()
Generate a list of nodes that reach a solution.

Returns:
the list of nodes that reach a solution.