General game playing (GGP) is the design of artificial intelligence programs that can play games it has never seen before by figuring out the strategy on the go. Monte Carlo Tree Search (MCTS) is a popular method for developing GGP AI. MCTS along with its enhancements have some parameters that control the algorithm. Usually, these parameters are tuned on-line by trying many combinations manually. This means the AI may perform well in some games and perform badly in some others. This project aims to implement an online parameter tuning strategy i.e. a self-adaptive MCTS (SA-MCTS) strategy that finds the best parameters for the particular game while performing the search.
This is an implemention of C. F. Sironi, J. Liu and M. H. M. Winands, "Self-Adaptive Monte Carlo Tree Search in General Game Playing," in IEEE Transactions on Games, vol. 12, no. 2, pp. 132-144, June 2020, doi: 10.1109/TG.2018.2884768
- Clone / download this code.
- You can run
benchmark.py
to perform benchmarking. You can either choose to benchmark a particular allocation strategy or you can choose to benchmark all allocation strategies against an offline tuned agent.
- Fork this repo
- Clone your forked repo using the command
git clone <url to your fork>
- Run
pip install -r requirements.txt
to install dependencies - Make changes
- To commit your changes run the following commands:
git add .
git commit -m "write a short message here denoting the change you are making"
git push origin master
- Now make a pull request
main.py / benchmark.py
- main.py: Can be used for testing during development
- benchmark.py: Used to benchmark the agents
- game.py: Exports a
Game
class that can be used to specify the agents that'll play the game and the game type. The game can be played by calling theplayGame()
method - used by main.py and benchmark.py
agentsList.py and Agent.py
- agentsList.py:
- Exports the names of the supported agent types
- Exports
benchmarkList
which is an iterable list of the supported agent types
- Agent.py: The AI agent that uses an allocation strategy from /tuners and MCTS simulation defined in mcts.py
Any one of the tuner (nmc.py or cmaes.py)
All tuners implement the methods defined in TunerMeta
. These methods serve as an API to interact with any tuner.
All tuners should extend the TunerMeta
base class
gamesList.py and games.py
All games implement the methods defined in BoardMeta
. These methods serve as an API to interact with any game.
All games should extend the BoardMeta
base class
- gamesList.py:
- Exports the names of the available games
- Exports
benchmarkList
which is an iterable list of the available games
- games.py: Exports a function to get an instance of a game board
- Ramvardhan R. (https://github.com/ram-the-coder)
- Sathish Kumar E. (https://github.com/sathishk0230)
- Sudharshan V. (https://github.com/Sudharshanv2000)