This repository contains an implementation of an AI player for the board game Tablut. The AI has been developed as part of a university exam module for FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE AND KNOWLEDGE REPRESENTATION.
- Clone the repository:
git clone https://github.com/NotXia/tablut-player
- Install the dependencies:
cd tablut-player
pip install -r requirements.txt
- If you want to use the Cython version:
cd src
python setup.py build_ext --inplace
To start the genetic algorithm to train the weights for the heuristics, run:
cd src/ga-training
python train.py \
--epochs [num epochs] \
--indivs [num individuals per population] \
--timeout [timeout for decision] \
--output [weights output directory] \
--mutation-value [amount of each mutation] \
--mutation-prob [probability of mutation] \
--gui
Check python train.py --help
for more options.
In the src
directory, run:
python play.py \
--color [WHITE/BLACK] \
--ip [server ip] \
--timeout [seconds] \
--tol [timeout tolerance] \
--weights [path to weights] \
--tt-size [transposition table size] \
--debug
To run the server you need to follow the guide on the tablut server repo.