mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-24 14:15:17 +02:00
rename expo folder to sela
This commit is contained in:
parent
4bed19b931
commit
7c5b29de63
33 changed files with 53 additions and 53 deletions
19
sela/Greedy.py
Normal file
19
sela/Greedy.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import random
|
||||
|
||||
from sela.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))
|
||||
|
||||
|
||||
class Random(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 random.choice(all_children)
|
||||
Loading…
Add table
Add a link
Reference in a new issue