mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-29 02:46:24 +02:00
9 lines
325 B
Python
9 lines
325 B
Python
from expo.MCTS import MCTS
|
|
|
|
|
|
class Greedy(MCTS):
|
|
def best_child(self):
|
|
if len(self.children) == 0:
|
|
return self.root_node
|
|
all_children = [child for children in self.children.values() for child in children]
|
|
return max(all_children, key=lambda x: x.normalized_reward.get("dev_score", 0))
|