This project contains a basic implementation of the Monte Carlo Tree Search. Furthermore, you can find some other agents (AlphaBeta, Random) which you can try out against MCTS.
For those who find this algorithm interesting I will also add some further reading/information below.
I would be really pleased about some suggested improvements for my code or other stuff like documentation.
To see a first result just execute RunMatch.py
python RunMatch.py
To change the agents you just need to change the first parameter in the Match obj. The possible agents are "MCTS", "REALWORLD" (you can play), "ALPHABETA" and "RANDOM". The first element of the tuple is player 1. The second element of the tuple is player 2.
match = Match(("MCTS", "ALPHABETA"), start_board)
There are some parameters you can change to experiment with the results.
For example, you can change the depth in AlphaBeta.py (line 6).
def get_action(self, state, player_id, depth=6):
another parameter you can change is max_time in MCTS.py (line 129). With this you can change the duration of MCTS.
def runMCTS(self, player_id, max_time=5):