MctsError

Enum MctsError 

Source
pub enum MctsError {
    InvalidState(u8),
    InvalidEvaluationCount(usize, usize),
    SearchAlreadyOver,
    ActionOutOfRange(usize, usize),
    InvalidAction(usize),
    UnexploredAction,
}
Expand description

Represents possible errors that can occur during MCTS (Monte Carlo Tree Search) operations.

Variants§

§

InvalidState(u8)

Indicates that an MCTS operation was attempted when the instance was not in the required state (e.g., calling apply_simulation without start_iteration, or calling any method while in Locked state).

§

InvalidEvaluationCount(usize, usize)

Occurs when the number of provided evaluations does not match the expected count (e.g., in MctsBatch::apply_simulation). Contains (expected_count, received_count).

§

SearchAlreadyOver

already represents a finished game state. Further iterations or plays are not possible.

§

ActionOutOfRange(usize, usize)

Occurs when an action index provided is outside the valid range [0, N-1] for the game. Contains the (attempted_action_index, max_action_index_N).

§

InvalidAction(usize)

Indicates that a chosen action is invalid according to the game’s mask. This means the game state does not allow this action. Contains the invalid action index.

§

UnexploredAction

Occurs when an action cannot be checked or played because the root node is none, it has not yet been explored and added to the MCTS tree.

Trait Implementations§

Source§

impl Debug for MctsError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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