package prbnmcn-mcts

  1. Overview
  2. Docs

The prbnmcn-mcts Monte-Carlo tree search library.

Introduction

prbnmcn-mcts provides a DSL to describe lazy exploration trees where nodes correspond to non-deterministic choices indexed by possible actions. Only finitely branching trees are allowed. The library provides facilities to explore these trees (ie perform choices iteratively), either by specifying programatically which choices are to be made, or (and this is the main point of the library) by letting a Monte-Carlo tree search (MCTS) routine perform automatically an evaluation of the value of each action. This value is determined thanks to an user-provided reward function, which associates each state at each choice point and each terminal value with a reward.

A classical application is to board games, where:

  • each choice point corresponds to a board in a given configuration and the currently active player
  • the actions corresponds to legal moves by the currently active player
  • the reward function is 0 if the player loses and 1 if the player wins
type ('a, 'b) refl_eq =
  1. | Refl : ('a, 'a) refl_eq

Refl is a proof of type equality.

module type Mcts_state = sig ... end

Mcts_state is a module type describing a type of states 'a t and the actions of type 'a available in that state.

module type S = sig ... end

A module of type S implements a monadic interface to building lazy search trees and allow their guided exploration using Monte-Carlo tree search.

module Ucb1 (State : Mcts_state) : S with type 'a state = 'a State.t

Implementation of MCTS based on UCB1 bandits.

OCaml

Innovation. Community. Security.