pub enum NodeType<G: Game> {
Terminal(f64),
Chance(Option<G::ChanceInfoset>, G::Chance),
Player(PlayerNum, G::Infoset, G::Player),
}Expand description
Which kind of node a Game state is, with the data needed to enumerate its children.
Returned by Game::into_node. Splitting the per-kind data into variants is what keeps the
node-specific operations mutually exclusive: a terminal carries only a payoff, a player node an
infoset, and a chance node an optional sampling key (None for a unique, uncorrelated node).
Variants§
Terminal(f64)
A terminal state, holding the payoff to player one.
Chance(Option<G::ChanceInfoset>, G::Chance)
A chance node: an optional sampling key (None is a unique, uncorrelated node) and the
weighted outcomes.
Player(PlayerNum, G::Infoset, G::Player)
A player decision: the acting player, its infoset, and the legal moves.
Auto Trait Implementations§
impl<G> Freeze for NodeType<G>
impl<G> RefUnwindSafe for NodeType<G>where
<G as Game>::Chance: RefUnwindSafe,
<G as Game>::Infoset: RefUnwindSafe,
<G as Game>::Player: RefUnwindSafe,
<G as Game>::ChanceInfoset: RefUnwindSafe,
impl<G> Send for NodeType<G>
impl<G> Sync for NodeType<G>
impl<G> Unpin for NodeType<G>
impl<G> UnsafeUnpin for NodeType<G>where
<G as Game>::Chance: UnsafeUnpin,
<G as Game>::Infoset: UnsafeUnpin,
<G as Game>::Player: UnsafeUnpin,
<G as Game>::ChanceInfoset: UnsafeUnpin,
impl<G> UnwindSafe for NodeType<G>where
<G as Game>::Chance: UnwindSafe,
<G as Game>::Infoset: UnwindSafe,
<G as Game>::Player: UnwindSafe,
<G as Game>::ChanceInfoset: 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