Struct arbor::MCTS

source · []
pub struct MCTS<P: Player, A: Action, S: GameState<P, A>> {
    pub info: Info,
    /* private fields */
}
Expand description

This struct is the main launch point for this crate. It holds the state of execution for the MCTS algorithm. Use it’s associated methods to operate the search and tune performance.

Fields

info: Info

Provides metrics about the shape and size of the game tree. For informational purposes only.

Implementations

Call this method to instantiate a new search with default parameters. The root game state from which to search is passed as a value to be owned by the MCTS struct.

Pick the best move after some time spent pondering. Returns None if ponder has not yet been called.

Iterate through the actions in the first ply. The callback f is called for each action in the first ply with a tuple of (a, w, s) where a is the action, w is the expected value of the action, and s is the confidence in the value of the action. s is similar to standard deviation where closer to zero is more confident.

Call this method to search the root game state a given number of iterations. This method may be called any number of times to improve the search results. Call ply or best to get the current search results.

Sets the exploration parameter. This sets the balance between exploration and exploitation when MCTS determines which action to choose. Set to a value > 0.

Sets the expansion parameter. This is the minimum number of times a leaf node should be visited before expanding it into a branch node.

Enables the custom evaluation method.

Enables transposition detection. Experimental.

Seeds the internal random number generator from entropy. This is inteneded to produce non-deterministic search results.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.