A bot that can play any two-player game, based on Monte-Carlo Tree Search (MCTS)
C++ Python CMake Shell
Switch branches/tags
Nothing to show
Latest commit d01fe09 Feb 4, 2017 @joelthelion committed on GitHub Merge pull request #2 from elcerdo/master
awale
Permalink
Failed to load latest commit information.
docs
.gitignore
CMakeLists.txt
COPYING
README.txt
benchmark.sh
board.cpp
board.h
boardawale.cpp
boardawale.h
boardblocks.cpp
boardblocks.h
boardc4.cpp
boardc4.h
boardc5.cpp
boardc5.h
boardmatches.cpp
boardmatches.h
boardothello.cpp
boardothello.h
bot_bot.cpp
bot_bot_gui.cpp
common.h
human_bot.cpp
parse_log.py
player.cpp
player.h
qboardc4.cpp
qboardc4.h
qgamethread.cpp
qgamethread.h
qgamewindow.cpp
qgamewindow.h
test_board.cpp
test_nested.cpp
test_uct.cpp
uct.cpp
uct.h
utils.cpp
utils.h

README.txt

COPYRIGHT NOTICE

    Copyright Pierre Gueth and Joel Schaerer, 2009

    uct is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    uct is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with uct.  If not, see <http://www.gnu.org/licenses/>.

SYNOPSIS

    This is a generic framework for implementing UCT-based AIs for two
    player games. It is based on the Upper Confidence bounds applied to Trees
    algorithm, as described here:

    http://hal.inria.fr/docs/00/12/15/16/PDF/RR-6062.pdf

    This algorithm is famous for having improved the strength of Go AIs by at
    least ten kyus, which is *a lot*. The algorithm is very general, and can
    be used to create decent AI for two-player games such as chess, checkers,
    go, othello, etc. All you need to do in order to implement a new game is 
    to write a class with a very minimal interface: with a given position,
    test for a win, give possible moves, play a random move and a few others.
    You can check the complete interface in board.h. Once the game knowledge
    is described in this class, UCT will do the hard part for you, ie. chosing
    the best move :) Even better, it will demonstrably play the best move,
    given infinite time.

BUILD INSTRUCTIONS

    Make sure you have CMake and Qt installed. Then:
    ccmake . && make

IMPLEMENTATION

    This library is divided in two pieces: the generic UCT algorithm, in the
    files uct.cpp and uct.h, which you don't need to change if you just want
    to implement a new game. The other files are either game descriptions or
    human interfaces (this version is shipped with sample implementations of
    connect 4 and othello, with a QT Gui for the connect 4 game).

    Adding a new game in a nutshell:
    - copy boardc4.h and boardc4.cpp
    - rename MoveC4 and BoardC4 to match the classes of your game.
    - write the implementation in the cpp file (this is the hardest step).
    - add the cpp file in the CMakeLists.txt.
    - add your game name in the Game enum in utils.h.
    - add parsing code in parse_game in utils.cpp.
    - ...
    - profit