MCPcopy Create free account
hub / github.com/MARIO-Math-Reasoning/Super_MARIO / BaseNode

Class BaseNode

mcts_math/nodes/base_node.py:13–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13class BaseNode(BaseModel):
14
15 state: Dict[str, str] = {"text": "", "extra_info": ""}
16 additional_state_keys: List[str] = []
17 parent: Optional[Any] = None
18 children: List[Any] = []
19 depth: int = 0
20 is_terminal: bool = False
21 reward: Optional[float] = None
22 value: Optional[float] = -100
23
24 tag: str = "0"
25 consecutive_errors: int = 0
26
27 def __init__(self, **kwargs) -> None:
28 super().__init__(**kwargs)
29
30 for key in self.additional_state_keys:
31 self.state[key] = ""
32
33 def has_children(self) -> bool:
34 return self.children != []
35
36 def is_root(self) -> bool:
37 return self.parent is None

Callers 1

create_nodeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected