forked from s464965/WMICraft
feat: expand and child node
This commit is contained in:
parent
10485ce39d
commit
019b3c86be
@ -45,11 +45,16 @@ class Node:
|
|||||||
return hash(self.state)
|
return hash(self.state)
|
||||||
|
|
||||||
|
|
||||||
def child_node(action: Action) -> Node:
|
def expand(node: Node) -> List[Node]:
|
||||||
pass
|
return [child_node(node=node, action=action) for action in actions(node.state)]
|
||||||
|
|
||||||
|
|
||||||
def actions(state: State) -> List[str]:
|
def child_node(node: Node, action: Action) -> Node:
|
||||||
|
next_state = result(state=node.state, action=action)
|
||||||
|
return Node(state=next_state, parent=node, action=action)
|
||||||
|
|
||||||
|
|
||||||
|
def actions(state: State) -> List[Action]:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user