pub struct Node<M> {
pub last_move: Option<M>,
pub children: Option<IdxRange>,
pub visits: i64,
pub kind: SNodeKind,
}Expand description
Represents a node in the MCTS search tree.
The outcome or wdl in this node are always from the POV of the player that just played self.last_move.
Fields§
§last_move: Option<M>§children: Option<IdxRange>§visits: i64§kind: SNodeKindImplementations§
Source§impl<M> Node<M>
impl<M> Node<M>
pub fn is_unvisited(&self) -> bool
Sourcepub fn solution(&self) -> Option<OutcomeWDL>
pub fn solution(&self) -> Option<OutcomeWDL>
Return the solution (if any) from the POV of the player that just played self.last_move.
pub fn mark_solved(&mut self, outcome: OutcomeWDL)
pub fn increment(&mut self, outcome: OutcomeWDL)
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for Node<M>where
M: Freeze,
impl<M> RefUnwindSafe for Node<M>where
M: RefUnwindSafe,
impl<M> Send for Node<M>where
M: Send,
impl<M> Sync for Node<M>where
M: Sync,
impl<M> Unpin for Node<M>where
M: Unpin,
impl<M> UnwindSafe for Node<M>where
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more