Package search
Class Nodes.SimpleTreeNode<S>
java.lang.Object
search.Nodes.SimpleTreeNode<S>
- Type Parameters:
S
- The type of the search state underlying these nodes.
- All Implemented Interfaces:
SearchTreeNode<Nodes.SimpleTreeNode<S>,S>
- Enclosing class:
- Nodes
public static class Nodes.SimpleTreeNode<S> extends Object
Simple implementation of search tree
nodes, expecting that the
Exp
type argument of the
Nodes.SimpleCoreTreeNode
will be just the search state type.-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Iterable<Nodes.SimpleTreeNode<S>>
expand()
Expands the search node into successor nodes.S
getState()
Returns the search state underlying this node.static <S> Function<S,Nodes.SimpleTreeNode<S>>
initializer(Function<S,Iterable<S>> expander)
Returns a factory for tree nodes given an expander from a state to the states underlying expanded nodes.String
toString()
Format this node as a string, typically for debugging.
-
Constructor Details
-
SimpleTreeNode
Sole constructor for this class.- Parameters:
expander
- Function from the underlying state to an iterable collection of information leading to expanded nodes.state
- The state underlying this node.
-
-
Method Details
-
expand
Expands the search node into successor nodes.- Returns:
- An
Iterable
instance of the successor nodes.
-
initializer
public static final <S> Function<S,Nodes.SimpleTreeNode<S>> initializer(Function<S,Iterable<S>> expander)Returns a factory for tree nodes given an expander from a state to the states underlying expanded nodes. -
getState
Returns the search state underlying this node.- Specified by:
getState
in interfaceSearchTreeNode<Self extends search.Nodes.SimpleCoreTreeNode<Self,Exp,S>,Exp>
-
toString
Format this node as a string, typically for debugging.
-