MCPcopy Create free account
hub / github.com/bupticybee/TexasSolver / __init__

Method __init__

resources/python/TreeBuilder.py:539–557  ·  view source on GitHub ↗
(self, parent, committed, players, player,  bet_history,betting_round=None,**kwargs)

Source from the content-addressed store, hash-verified

537
538class ShowdownNode(ActionNode):
539 def __init__(self, parent, committed, players, player, bet_history,betting_round=None,**kwargs):
540 super().__init__(parent, committed, players, player, bet_history,betting_round=betting_round, ** kwargs)
541 self.last_action = kwargs['last_action']
542 if parent:
543 self.parent.add_child(self,self.last_action)
544
545 self.payoffs = {}
546 # payoff's key is player id represent what happens if player i wins
547 # it's value is payoffs for all players if player i wins
548
549 for i in players:
550 # everybody throw in money
551 self.payoffs[i] = [-i for i in self.committed]
552 # winner get all money
553 self.payoffs[i][i] += self.pot
554
555 # 仅考虑两个玩家的情况
556 self.payoffs['tie'] = [-i + (self.pot / 2) for i in self.committed]
557 self.showdown = True
558
559 def add_child(self, child,action):
560 # Showdown Node shouldn't have any child

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
add_childMethod · 0.45

Tested by

no test coverage detected