Struct MctsConfig

Source
pub struct MctsConfig<const N: usize> {
    pub exploration_coef: f64,
    pub selection_function: SelectionFunction<N>,
}
Expand description

Configuration parameters for a single Monte Carlo Tree Search (MCTS) instance.

This struct allows customization of MCTS behavior, including the exploration-exploitation balance and the specific function used to calculate node selection scores.

§Type Parameters

  • N: The number of possible actions in the game.

Fields§

§exploration_coef: f64

The exploration coefficient (often denoted as C_p or C_u) used in the selection phase.

A higher value encourages more exploration of less-visited nodes, while a lower value prioritizes exploitation of known good paths.

§selection_function: SelectionFunction<N>

The function used to calculate the selection score for a child node during MCTS traversal.

This function typically balances exploitation (based on value) and exploration (based on visits). You can use provided functions like ucb1 or default_selection_score, or define your own.

Implementations§

Source§

impl<const N: usize> MctsConfig<N>

Source

pub const DEFAULT: MctsConfig<N>

The default MCTS configuration.

  • exploration_coef: std::f64::consts::SQRT_2 (approximately 1.414), a common choice for UCB1.
  • selection_function: default_selection_score, the default formula.

Auto Trait Implementations§

§

impl<const N: usize> Freeze for MctsConfig<N>

§

impl<const N: usize> RefUnwindSafe for MctsConfig<N>

§

impl<const N: usize> Send for MctsConfig<N>

§

impl<const N: usize> Sync for MctsConfig<N>

§

impl<const N: usize> Unpin for MctsConfig<N>

§

impl<const N: usize> UnwindSafe for MctsConfig<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V