|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SearchNode
public abstract class SearchNode
SearchNode.java - a simple node for uninformed AI search (assuming cost equals depth).
Field Summary | |
---|---|
SearchNode |
parent
variable parent - parent search node; null if and
only if node is the root of the search tree. |
Constructor Summary | |
---|---|
SearchNode()
Creates an SearchNode instance and sets it to an
initial search state. |
Method Summary | |
---|---|
SearchNode |
childClone()
childClone - returns a clone of this node that has
been made a child of this node and has a depth one greater than
this. |
java.lang.Object |
clone()
clone - performs a DEEP clone (copy) of this
node. |
abstract java.util.ArrayList<SearchNode> |
expand()
expand - return a (possibly empty) ArrayList of this
node's children. |
abstract boolean |
isGoal()
isGoal - test whether or not the current node is a
goal node. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public SearchNode parent
parent
- parent search node; null if and
only if node is the root of the search tree.
Constructor Detail |
---|
public SearchNode()
SearchNode
instance and sets it to an
initial search state. One will generally want to override this
constructor to initialize a root node for search.
Method Detail |
---|
public abstract boolean isGoal()
isGoal
- test whether or not the current node is a
goal node.
boolean
value - whether or not the
current node is a goal nodepublic abstract java.util.ArrayList<SearchNode> expand()
expand
- return a (possibly empty) ArrayList of this
node's children. A new child is created by calling
childClone
and appropriately modifying the state
of the returned node.
ArrayList
of SearchNodes that are children
of this nodepublic SearchNode childClone()
childClone
- returns a clone of this node that has
been made a child of this node and has a depth one greater than
this.
SearchNode
valuepublic java.lang.Object clone()
clone
- performs a DEEP clone (copy) of this
node. That is, any change to the original/cloned node should
have no side-effect on the other. For example, when the node's
state is described using an array, you must create a new array
for the cloned node and copy the contents of the original node
array.
clone
in class java.lang.Object
Object
value
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |