Crates.io | oxymcts |
lib.rs | oxymcts |
version | 0.1.0 |
source | src |
created_at | 2020-09-04 09:30:10.96514 |
updated_at | 2020-09-04 09:30:10.96514 |
description | Library for general traits and default implementations for Monte Carlo Tree Search |
homepage | |
repository | https://github.com/sagebati/oxymcts |
max_upload_size | |
id | 284604 |
size | 35,984 |
If you don't know what is monte carlo tree search, I bet you know about AlphaGo the program that beat the best Go player in the world. Their approach was innovative because they used a neural network. but the neural network was not alone, the NN was "only" leading the MCTS.
For more : Wikipedia link
Library to play with an monte carlo tree search, it's generic over the game. see examples/tictactoe
.
This lib is also generic over the implementation and modular. indeed a normal MCTS can be divided in four operations,
tree policy(selection, expansion)
, simulation
, backprogation
.
With this implementation we can change the simulation without changing the selection for example. Any programmed operations
are interchangeable. So anyone can implement his tree policy
without touching at my code and it will run. We can view this library as a
collection of traits for the mcts and the glue. Easily extendable.
This tree doesn't store the "game" state in the tree's nodes instead it stores only the historic of moves until the state. This approach can be beneficial if the "state" is an memory intensive struct. it will also helps for future parallelization.
With C = 1.41421, 10000 rollouts, in a tictactoe of dim 6, in 1000 games versus a random bot who begins the mcts wins 52.4% of time, there is 41.5% nulls, so random bot wins 6.1% of the time (see examples/tictactoe)