Coder Social home page Coder Social logo

adamstelmaszczyk / gtsa Goto Github PK

View Code? Open in Web Editor NEW
83.0 7.0 20.0 646 KB

Game Tree Search Algorithms - C++ library for AI bot programming

License: GNU General Public License v3.0

Makefile 1.94% C++ 98.06%
algorithm artificial-intelligence search-algorithm game-theory bot game ai

gtsa's Introduction

Game Tree Search Algorithms Build Status Coverage Status

C++ library for AI bot programming.

Usage

  1. Specify game rules by subclassing State and Move.
  2. Choose AI algorithm (Minimax, MonteCarloTreeSearch), play by yourself (Human) or against external program (Executable).
  3. Read the game state, pass it to the algorithm and output the move. For local, statistically significant tests, use Tester.

Game examples

Implemented algorithms

Both handle sequential, multiplayer games:

MCTS also handles simultaneous games using SUCT.

Make commands

Execute below commands in the cpp directory.

  • make builds everything.
  • make test runs unit tests.
  • make valgrind runs valgrind's memory leak tests.
  • make play_isola plays as many games as needed to determine which Isola bot is better.

For all the commands check Makefile file.

Dependencies

  • To build and run unit tests, g++ and libboost-all-dev packages are needed.
  • To run valgrind, valgrind package is needed.
  • To make GIFs, imagemagick package is needed.

You can install all of them with sudo apt-get install g++ libboost-all-dev valgrind imagemagick.

Priorities of the library

  1. Correctness.
  2. Compliance with environment typical for competitions. One process. One file submission, compiled with one invocation of g++.
  3. Performance.

Would like to help?

Suggestions welcome on Issues. Pull requests too.

If you use code or ideas from this repository, please cite it as follows:

@misc{stelmaszczyk2015gtsa,
    author = {Stelmaszczyk, Adam},
    title = {Game Tree Search Algorithms},
    year = {2015},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/AdamStelmaszczyk/gtsa}},
}

gtsa's People

Contributors

adamstelmaszczyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtsa's Issues

std namespace

Your gtsa header is

using namespace std;

I think you should remove it, because if I use your header the standard namespaces could clash with my own implementations (or someone might not notice it uses the wrong library)

input() doesn't work in Python 2

Now on user input used in Human it will raise run-time exception in Python 2.

Have to look for input() which works in Python 2 and 3.

MCTS can be probably much faster

Right now MCTS does lots of memory allocations. If it used continuous, pre-allocated memory, caching would be better, which will probably significantly boost the overall performance.

Mirror library in C++

Currently only Python library is available. In parallel to it, mirror library will be available, in C++.

Python was chosen because of the speed and ease of development and prototyping. New features and upgrades will be always implemented and tested there first.

However, Python is unfortunately much slower than compiled C++. So, to gain probably like 10-100x speed up there will be a mirror library, a port from Python to C++. Performance is important, 100x speed up means 100x more simulations (within the time limit which always exists during competitions).

The libraries will be both in the same repository. There will be two root directories - python and cpp.

MTD-f

This paper claims that MTD-f is 5-10% faster than than alpha-beta.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.