Skip to content

Instantly share code, notes, and snippets.

@masouduut94
Created October 23, 2020 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masouduut94/7f9113b51439d9184ae0d1b18403e857 to your computer and use it in GitHub Desktop.
Save masouduut94/7f9113b51439d9184ae0d1b18403e857 to your computer and use it in GitHub Desktop.
class UctMctsAgent:
"""
Basic no frills implementation of an agent that preforms MCTS for hex.
Attributes:
root_state (GameState): Game simulator that helps us to
understand the game situation.
root (Node): Root of the tree search.
run_time (int): time per each run.
node_count (int): the whole nodes in tree.
num_rollouts (int): The number of rollouts for each search.
"""
def __init__(self, state=GameState(8)):
self.root_state = deepcopy(state)
self.root = Node()
self.run_time = 0
self.node_count = 0
self.num_rollouts = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment