From 0507d3eff1438201e44a746288ea3ea6c6cf1f7e Mon Sep 17 00:00:00 2001 From: Konstantinos Varsos Date: Tue, 17 Oct 2023 13:37:07 +0100 Subject: [PATCH] Revise MixedBehaviorProfile.belief to allow for general node reference selector. Closes #355. --- src/pygambit/behav.pxi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pygambit/behav.pxi b/src/pygambit/behav.pxi index f14d00fe2..e90e9b42e 100644 --- a/src/pygambit/behav.pxi +++ b/src/pygambit/behav.pxi @@ -255,7 +255,7 @@ class MixedBehaviorProfile: """ return self._is_defined_at(self.game._resolve_infoset(infoset, 'is_defined_at')) - def belief(self, node: Node): + def belief(self, node: typing.Union[Node, str]): """Returns the conditional probability that a node is reached, given that its information set is reached. @@ -271,7 +271,7 @@ class MixedBehaviorProfile: """ if node.game != self.game: raise MismatchError("belief: node must be part of the same game as the profile") - return self._belief(node) + return self._belief(self.game._resolve_node(node, 'belief')) def payoff(self, player: typing.Union[Player, str]): """Returns the expected payoff to a player if all players play