Skip to content

mctsSearch

mctsSearch<S, M, P>(game, state, options?): MctsResult<M>

Defined in: src/modules/game-search/mcts.ts:76

Looks ahead with Monte Carlo tree search and returns the most promising move for the player to move in state.

Each iteration walks down the tree that has been built so far, favouring moves that did well (UCT), adds one new position, plays it out with random moves to the end of the game and credits the result to every move on the way. A move is credited to the player who made it, so any number of players and moves that leave the same player to move work. The tree lives for one call.

Throws when a budget option or exploration is negative or not a number.

S

M

P = number

SearchGame<S, M, P>

S

MctsOptions<S, M, P> = {}

MctsResult<M>