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.