MCPcopy Create free account
hub / github.com/algorithmicsuperintelligence/optillm / simulate_async

Method simulate_async

optillm/rstar.py:56–69  ·  view source on GitHub ↗
(self, node: Node)

Source from the content-addressed store, hash-verified

54 return child_node
55
56 async def simulate_async(self, node: Node) -> float:
57 current_node = node
58 depth = 0
59 logger.debug("Starting simulation")
60 while depth < self.max_depth:
61 if not current_node.children:
62 action = random.choice(self.actions)
63 current_node = await self.expand_async(current_node, action)
64 else:
65 current_node = random.choice(current_node.children)
66 depth += 1
67 value = self.evaluate(current_node)
68 logger.debug(f"Simulation complete. Final value: {value}")
69 return value
70
71 async def mcts_async(self, root_state: str) -> List[Node]:
72 root = Node(root_state, None)

Callers 1

mcts_rollout_asyncMethod · 0.95

Calls 2

expand_asyncMethod · 0.95
evaluateMethod · 0.95

Tested by

no test coverage detected