Skip to content

DongCG/monte-carlo-tree-search

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of basic Monte Carlo Tree Search algorithm for Tic Tac Toe

This is supplementary code for Monte Carlo Tree Search tutorial blog post here

to run try:

import numpy as np
from mcts.nodes import *
from mcts.search import MonteCarloTreeSearch
from games.tictactoe import TicTacToeGameState

state = np.zeros((3,3))
initial_board_state = TicTacToeGameState(state = state, next_to_move = 1)

root = TwoPlayersGameMonteCarloTreeSearchNode(state = initial_board_state, parent = None)
mcts = MonteCarloTreeSearch(root)
best_node = mcts.best_action(1000)

About

Monte carlo tree search in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%