#[non_exhaustive]pub enum GameError {
EmptyChance,
NonPositiveChance,
ProbabilitiesNotEqual,
ImperfectRecall,
EmptyPlayer,
ActionsNotEqual,
ActionsNotUnique,
}
Expand description
Errors that result from game definition errors
If the object passed into Game::from_root doesn’t conform to necessary invariants, one of these will be returned.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyChance
Returned when a chance node has no outcomes
NonPositiveChance
Returned when a chance node has an outcome with a non-positive probability of happening
ProbabilitiesNotEqual
Returned when a chance node has different probabilities than another node in its infoset
ImperfectRecall
Returned when a game’s infosets don’t exhibit perfect recall
If a game does have perfect recall, then a player’s infosets must form a tree, that is for all game nodes with a given infoset, the infoset of the player’s previous action must be identical. We ignore this criterion for single action infosets since they don’t actually reflect a decision.
EmptyPlayer
Returned when a player node has no actions
ActionsNotEqual
Returned when the actions of a player node didn’t match the order and values of an earlier information set.
Make sure that all nodes with the same player and information set also have the same actions in the same order.
ActionsNotUnique
Returned when the actions of a player node weren’t unique.
Make sure that all actions of a player node are unique.
Trait Implementations§
Source§impl Error for GameError
impl Error for GameError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
impl Copy for GameError
impl Eq for GameError
impl StructuralPartialEq for GameError
Auto Trait Implementations§
impl Freeze for GameError
impl RefUnwindSafe for GameError
impl Send for GameError
impl Sync for GameError
impl Unpin for GameError
impl UnwindSafe for GameError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
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>
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