pub struct Chance<'a, 'g> { /* private fields */ }Expand description
A chance node
A chance node represents a point in the game where things advance randomly, or alternatively, where “nature” takes a turn.
Implementations§
Source§impl<'a, 'g> Chance<'a, 'g>
impl<'a, 'g> Chance<'a, 'g>
Sourcepub fn name(self) -> &'a EscapedStr
pub fn name(self) -> &'a EscapedStr
The name of the node
Sourcepub fn infoset_name(self) -> &'a EscapedStr
pub fn infoset_name(self) -> &'a EscapedStr
The infoset’s label
Sourcepub fn actions(
self,
) -> impl Iterator<Item = (&'a EscapedStr, &'g BigRational, Node<'a, 'g>)> + 'g
pub fn actions( self, ) -> impl Iterator<Item = (&'a EscapedStr, &'g BigRational, Node<'a, 'g>)> + 'g
All possible actions with their names, probabilities, and resulting nodes
Sourcepub fn action(
self,
label: &EscapedStr,
) -> Option<(&'g BigRational, Node<'a, 'g>)>
pub fn action( self, label: &EscapedStr, ) -> Option<(&'g BigRational, Node<'a, 'g>)>
The probability and child for the action with the given label
Labels need not be unique within an infoset, so this returns the first match.
Sourcepub fn action_at(
self,
index: usize,
) -> Option<(&'a EscapedStr, &'g BigRational, Node<'a, 'g>)>
pub fn action_at( self, index: usize, ) -> Option<(&'a EscapedStr, &'g BigRational, Node<'a, 'g>)>
The name, probability, and child for the action at the given index
Sourcepub fn outcome_payoffs(self) -> Option<&'g [BigRational]>
pub fn outcome_payoffs(self) -> Option<&'g [BigRational]>
Outcome payoffs for this node
Outcome payoffs are added to every players’ payoffs for traversing through this node. Note that if these are missing, they be defined at another node sharing the same outcome.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'g> Freeze for Chance<'a, 'g>
impl<'a, 'g> RefUnwindSafe for Chance<'a, 'g>
impl<'a, 'g> Send for Chance<'a, 'g>
impl<'a, 'g> Sync for Chance<'a, 'g>
impl<'a, 'g> Unpin for Chance<'a, 'g>
impl<'a, 'g> UnsafeUnpin for Chance<'a, 'g>
impl<'a, 'g> UnwindSafe for Chance<'a, 'g>
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