示例#1
0
    def get_win_prob(self,state, playerid,hand_cards, board_cards,num_players):
        win = 0
        rounds=0
        evaluator = Evaluator()
        for i in range(self.simulation_number):

            board_cards_to_draw = 5 - len(board_cards)  # 2
            board_sample = board_cards + self._pick_unused_card(board_cards_to_draw,hand_cards+board_cards)
            unused_cards = self._pick_unused_card((num_players - 1) * 2, hand_cards + board_sample)
            board_sample = [Card.new(i) for i in board_sample]
            unused_cards = [Card.new(i) for i in unused_cards]
            opponents_hole = [unused_cards[2 * i:2 * i + 2] for i in range(num_players - 1)]
            #hand_sample = self._pick_unused_card(2, board_sample + hand_cards)
            try:
                opponents_score = [1 - evaluator.evaluate(hole, board_sample)/7462 for hole in opponents_hole]
                myhand_cards = [Card.new(i) for i in hand_cards]
                my_rank = 1 - evaluator.evaluate(myhand_cards, board_sample)/7462
                if my_rank >= max(opponents_score):
                    win += 1
                #rival_rank = evaluator.evaluate_hand(hand_sample, board_sample)
                rounds+=1
            except Exception as e:
                #print e.message
                continue
        win_prob = win / rounds
        return win_prob
示例#2
0
def monteCarlo(board, hand, numPlayers, monteN):
    deck = Deck()
    evaluator = Evaluator()
    playerHands = [None]*numPlayers
    winAmount = 0 
    board_backup = board.copy()
    for time in range(int(monteN)):
        board = board_backup.copy()
        monteDeck = [card for card in deck.cards if card not in board and card not in hand]
        for x in range(numPlayers):
            playerHands[x] = []
            for y in range(2):
                randomIndex = randrange(0, len(monteDeck))
                playerHands[x].append(monteDeck[randomIndex])
                del monteDeck[randomIndex]
        while len(board) < 5:
            randomIndex = randrange(0, len(monteDeck))
            board.append(monteDeck[randomIndex])
            del monteDeck[randomIndex]
        win = True
        
        handRank = evaluator.evaluate(board, hand)
        for x in range(numPlayers):
            otherRank = evaluator.evaluate(board, playerHands[x])
            if otherRank < handRank:
                win = False
                break
        if win:
            winAmount += 1
    return winAmount/monteN
示例#3
0
 def __init__(self, n_seats, ranking_encoding='norm', concat=True, drop_cards=False, split_cards=False):
     self.n_seats = n_seats
     self.ranking_encoding = ranking_encoding
     self._deck = np.array(Deck.GetFullDeck(), dtype=np.int64)
     self._deck_alt = np.concatenate((np.array([-1], dtype=np.int64), self._deck))
     self._evaluator = Evaluator()
     self.concat = concat
示例#4
0
    def _get_cards_rank(self, hole_card, round_state, debug_printouts):
        """
        :param hole_card: Hole cards of own player
        :param round_state: Current round state, containing community cards
        :param debug_printouts: Parameter for debugging purpose only. Allows printing the calculated hand rank
        :return: Float between 0 and 1, representing the current five card rank among all possible poker hands.
        0 represents the weakest five card combination, 1 the strongest (Royal Flush)
        """
        evaluator = Evaluator()

        board = []
        hand = []
        if len(round_state['community_card']) >= len(board):
            for card in round_state['community_card']:
                board.append(Card.new(card))

        for card in hole_card:
            hand.append(Card.new(card))

        score = evaluator.evaluate(board, hand)

        if debug_printouts:
            Card.print_pretty_cards(board + hand)
            print(Card.print_pretty_cards(board + hand))

        return 1 - evaluator.get_five_card_rank_percentage(score)
示例#5
0
def index():
    evaluator = Evaluator()
    deck = Deck()
    card = Card.new('Qh')
    board = deck.draw(5)
    player_names = ("player 1", "player 2", "player 3", "player 4", "player 5",
                    "player 6", "player 7", "player 8")
    players = {}
    output = {}
    # this is procedural programming, not functional programming :(
    for p in player_names:
        hand = deck.draw(2)
        score = evaluator.evaluate(board, hand)
        text = evaluator.class_to_string(evaluator.get_rank_class(score))
        players[p] = score
        output[p] = {'score': score, 'text': text}
    # What about a tie?
    tie = (len(players.values()) == len(set(players.values())))
    winner = min(
        players,
        key=players.get)  # always 1 result :( Don't forget to fix the TEST!
    # does the tie involve the winning hand though?
    # TODO https://stackoverflow.com/questions/17821079/how-to-check-if-two-keys-in-dictionary-hold-the-same-value
    output["winners"] = winner
    output["tie"] = tie
    output["card"] = Card.int_to_str(card)
    j = json.dumps(output)
    return j
示例#6
0
def getWinners(gameId, players):
    evaluator = Evaluator()
    boardCards = []
    rankings = {}

    _, board, _, _, _, _, _, _, _, _, _ = db.getGame(gameId)
    for i in board.split(":"):
        boardCards.append(pyDealerCardToDeucesCard(i))

    for i in players:
        cards = i[3]
        rankings[i[0]] = evaluator.evaluate(boardCards, [
            pyDealerCardToDeucesCard(cards.split(":")[0]),
            pyDealerCardToDeucesCard(cards.split(":")[1])
        ])

    v = list(rankings.values())
    minValue = min(v)

    winners = []
    for i in rankings:
        if rankings[i] == minValue:
            winners.append([
                i,
                evaluator.class_to_string(evaluator.get_rank_class(minValue))
            ])

    return winners
示例#7
0
 def __init__(self, n_seats, ranking_encoding='norm'):
     self.n_seats = n_seats
     self.ranking_encoding = ranking_encoding
     self.n_dim = 265 + 104 + 6 + n_seats + 6 * n_seats + (7463 if ranking_encoding == 'one-hot' else 1 if ranking_encoding == 'norm' else 0)
     self._deck = np.array(Deck.GetFullDeck(), dtype=np.int64)
     self._deck_alt = np.concatenate((np.array([-1], dtype=np.int64), self._deck))
     self._evaluator = Evaluator()
示例#8
0
 def __init__(self):
     self.current_table = Table()
     self.current_table.BuyIn(100)
     self.current_table.BuyIn(100)
     self.evaluator = Evaluator()
     self.board = []
     self.game_string = ""
示例#9
0
async def find_best_plo_hand(user_id, channel_id):
    active_players = player_list[channel_id]
    tab = tab_list[channel_id]["table"]
    evaluator = Evaluator()
    board = tab.cards
    print(board, "board")
    hand = [x.cards for x in active_players if x.name == user_id]
    hand = hand[0]
    print(hand, "hand")
    allboardtuple = list(itertools.combinations(board, 3))
    print(allboardtuple)
    allboardlist = [list(x) for x in allboardtuple]
    print(allboardlist)
    allhandtuple = list(itertools.combinations(hand, 2))
    print(allhandtuple, "allhandtuple")
    allhandlist = [list(x) for x in allhandtuple]
    print(allhandlist, "allhandlist")
    fullsetlist = []
    print("just before loop")
    for i in allboardlist:
        print(i, "inside loop i")
        for j in allhandlist:
            print(j, "inside loop j")
            fullsetlist.append(evaluator.evaluate(i, j))
    # for allboardlist, allhandlist in zip(allboardlist, allhandlist):
    #   fullsetlist.append(evaluator.evaluate(allboardlist, allhandlist))

    fullsetlist.sort()
    return fullsetlist[0]
示例#10
0
 def showdown(self, round_players):
     """
     Evaluate the best hand
     """
     board = create_board(self)
     high_scorer = self.dealer
     hand = create_hand(self.dealer)
     for card in self.dealer.player_cards():
         suit, rank = card.identify_card()
         print(suit + rank)
     min_score = evaluate_player_hand(
         board, hand)  #start with the dealer as the best hand
     for player in round_players:
         hand = create_hand(
             player)  #Find the highest hand and use that as the high scorer
         score = evaluate_player_hand(board, hand)
         if score < min_score:
             min_score = score
             high_scorer = player
     print("Player " + str(high_scorer.player_number()) + " has won!")
     high_scorer.win(self.pot)
     evaluator = Evaluator()
     winning_class = evaluator.get_rank_class(min_score)
     print("The winning hand was " +
           evaluator.class_to_string(winning_class) + '.')
示例#11
0
 def _rank_hands(self):
     ev = Evaluator()
     ranks = dict()
     for p in self.active_players:
         hand = self.players[p].hand
         rank = ev.evaluate(hand, self.board)
         ranks[p] = rank
     return ranks
示例#12
0
 def __init__(self, explore=0.1):
     # key of expected Dict is the combination of expected rank + treys rank
     # values of expected Dict are counter, reward times
     self.expectedActionDict = {}
     self.evaluator = Evaluator()
     self.explore = explore
     self.episode = 0
     self.episode_reward = 0
     self.fold_count = 0
示例#13
0
    def evaluateHands(self):

        # convert cards to correct format for treys library
        first_card_board = self.state.community_cards[0][
            'rank'] + self.state.community_cards[0]['suit'].lower()
        second_card_board = self.state.community_cards[1][
            'rank'] + self.state.community_cards[1]['suit'].lower()
        third_card_board = self.state.community_cards[2][
            'rank'] + self.state.community_cards[2]['suit'].lower()
        fourth_card_board = self.state.community_cards[3][
            'rank'] + self.state.community_cards[3]['suit'].lower()
        fifth_card_board = self.state.community_cards[4][
            'rank'] + self.state.community_cards[4]['suit'].lower()

        # then create a list of community cards
        board = [
            Card.new(first_card_board),
            Card.new(second_card_board),
            Card.new(third_card_board),
            Card.new(fourth_card_board),
            Card.new(fifth_card_board)
        ]

        results = {}

        # do the same thing for each active player
        evaluator = Evaluator()
        winning_hand = 7463

        players_in_hand = {
            k: v
            for k, v in self.state.players.items() if v.in_hand
        }
        for username, player in players_in_hand.items():

            first_card = player.hole_cards[0]['rank'] + player.hole_cards[0][
                'suit'].lower()
            second_card = player.hole_cards[1]['rank'] + player.hole_cards[1][
                'suit'].lower()

            hand = [Card.new(first_card), Card.new(second_card)]
            player_result = {}
            player_result['score'] = evaluator.evaluate(board, hand)
            player_result['hand_class'] = evaluator.get_rank_class(
                player_result['score'])
            player_result['hand_class_string'] = evaluator.class_to_string(
                player_result['hand_class'])

            results[username] = player_result

        # results = {'player0': {'score': 1, 'hand_class': 8, 'hand_class_string': 'Pair'},
        #     'player1': {'score': 1, 'hand_class': 8, 'hand_class_string': 'Pair'},
        #     'player2': {'score': 2, 'hand_class': 8, 'hand_class_string': 'Pair'},
        #     'player3': {'score': 1, 'hand_class': 8, 'hand_class_string': 'Pair'}
        # }

        return results
示例#14
0
    def evaluateFromState(self, state, playerid):
        # print("state",state.player_states[playerid].hand)
        evaluator = Evaluator()
        hand = []
        board = []
        # p1_score = evaluator.evaluate(board, player1_hand)
        for i in state.player_states[playerid].hand:
            hand.append(Card.new(card_to_normal_str(i)))
            # print(card_to_normal_str(i))
            # print(hand)

        for j in state.community_card:
            if j != -1:
                # print(card_to_normal_str(j))
                board.append(Card.new(card_to_normal_str(j)))
                # print(board)

        if len(board) == 0:
            rank = evaluator.evaluate(hand, [])
        elif len(board) == 3:
            rank = evaluator.evaluate(hand, board[:3])
        elif len(board) == 4:
            rank = evaluator.evaluate(hand, board[:4])
        elif len(board) == 5:
            rank = evaluator.evaluate(hand, board[:5])
        rank_class = evaluator.get_rank_class(rank)
        class_string = evaluator.class_to_string(rank_class)
        percentage = 1.0 - evaluator.get_five_card_rank_percentage(
            rank)  # higher better here
        # print("Player hand = {}, percentage rank among all hands = {}".format(class_string, percentage))
        return [rank, percentage]
示例#15
0
def evaluateCards(board, hand):
    board = [Card.new('Ah'), Card.new('Kd'), Card.new('Jc')]
    hand = [Card.new('Qs'), Card.new('Qh')]
    Card.print_pretty_cards(board + hand)

    evaluator = Evaluator()
    score = evaluator.evaluate(board, hand)
    handType = evaluator.get_rank_class(score)

    print("Player 1 hand rank = %d (%s)\n" %
          (score, evaluator.class_to_string(handType)))
示例#16
0
def setHandsStrenght(data, cards_players, cards_table, preflopRank):
    #Setting Board cards
    table_cards = []
    if cards_table[0] != '':
        for rounds in range(len(cards_table)):
            if rounds == 0:
                table_cards.append([
                    Card.new(cards_table[rounds][:2]),
                    Card.new(cards_table[rounds][2:4]),
                    Card.new(cards_table[rounds][4:6])
                ])
            if rounds == 1:
                table_cards.append((table_cards[0]).copy())
                table_cards[1].append(Card.new(cards_table[rounds]))

            if rounds == 2:
                table_cards.append(table_cards[1].copy())
                table_cards[2].append(Card.new(cards_table[rounds]))

    #Setting hand strenght into data
    evaluator = Evaluator()

    for game_state in range(len(data)):
        if 1 == 1:  #data[game_state] != []:
            for hand in range(len(data[game_state])):
                hand_cards = cards_players[data[game_state][hand][0]]

                if game_state == 0:
                    if hand_cards[1] == hand_cards[3]:
                        suit_char = 's'
                    else:
                        suit_char = 'o'

                    if hand_cards[0] == hand_cards[2]:
                        suit_char = 'p'

                    only_cards = hand_cards[0] + hand_cards[2]
                    hand_strength = findPreFlopRank(only_cards, suit_char,
                                                    preflopRank)

                else:
                    if len(table_cards) != 0:
                        hand_cards_obj = [
                            Card.new(hand_cards[:2]),
                            Card.new(hand_cards[2:])
                        ]
                        hand_strength = evaluator.evaluate(
                            table_cards[game_state - 1], hand_cards_obj)

                data[game_state][hand].insert(2, hand_strength)

    return data
示例#17
0
        def get_final_ranking():
            evaluator = Evaluator()
            final_ranking = list()

            for p in state.player_states:
                hand_cards = get_card_class(p.hand)
                board_cards = get_card_class(state.community_card)
                if not hand_cards:  # player not play this round
                    continue

                rank = evaluator.evaluate(hand_cards, board_cards)
                final_ranking.append(rank)
            return final_ranking
示例#18
0
文件: run.py 项目: befeltingu/DeepRL
    def __init__(self):

        self.actions = ['raise', 'check', 'call', 'fold']
        self.anticipatory = 0.1
        self.GameState = None  # tensor that tracks current state
        self.current_player = None
        self.deck = Deck()
        self.deck_lookup = None
        self.evaluator = Evaluator()
        self.S = 1000  # Starting stack
        self.SB = None
        self.BB = None
        self.players = ['_', self.SB, self.BB]
示例#19
0
def get_hands_score(player_hands, round_cards):
    hands_score = []
    evaluator = Evaluator()

    for player_hand in player_hands:
        hand_score = evaluator.evaluate(round_cards, player_hand['cards'])
        player_score = {
            'score': hand_score,
            'player_id': player_hand['player_id']
        }
        hands_score.append(player_score)

    return hands_score
示例#20
0
def should_call(hh):
    #Strictly whether or not I should've called or not (but not necessarily the information I want).
    #According to the treys library, score = rank ranging from 1(royal flush) to 7xxx(nut low).  Therefore the lower score (ex. rank 1) will beat the higher score (ex. rank 7xxx)
    evaluator = Evaluator()
    hero_score = evaluator.evaluate(community_board(hh['Summary']),
                                    hero_hole_cards(hh['Preflop']))
    villain_score = evaluator.evaluate(
        community_board(hh['Summary']),
        villain_hole_cards(hh['Showdown'], hh['River']))
    if villain_score > hero_score:
        return 1
    else:
        return 0
示例#21
0
async def calculate_plo(web_client, user_id, channel_id):
    active_players = player_list[channel_id]
    tab = tab_list[channel_id]["table"]
    evaluator = Evaluator()

    for name in active_players:
        high = await find_best_plo_hand(name.name, channel_id)
        print(high, name.name)
        rank = evaluator.get_rank_class(high)
        name.cardswords = evaluator.class_to_string(rank)
        name.score = high

    for name in active_players:
        pic = Card.print_pretty_cards(name.cards)
        await sendslack("<@%s> shows %s" % (name.name, pic), web_client, channel_id)

    for name in active_players:
        await sendslack(
            "<@%s> has %s" % (name.name, name.cardswords), web_client, channel_id
        )

    if active_players[0].score < active_players[1].score:
        await sendslack(
            "<@%s> wins %d" % (active_players[0].name, tab.pot), web_client, channel_id
        )
        active_players[0].money += tab.pot

    else:
        await sendslack(
            "<@%s> wins %d" % (active_players[1].name, tab.pot), web_client, channel_id
        )
        active_players[1].money += tab.pot

    if len(active_players) > 1:
        if active_players[0].money != 0 and active_players[1].money != 0:
            if active_players[1].dealer:
                active_players += [active_players.pop(0)]

            tab.cards.clear()
            tab.turn = 0
            tab.highbet = 0
            tab.pot = 0
            for name in active_players:
                name.cards.clear()
                name.tocall = 0
                name.dealer = False
                name.bet = 0
                name.reraise = 0
                name.canclose = False
            await set_up_game(web_client, channel_id, plo=True)
示例#22
0
def get_observation(data):
    global community_card
    # print(data)
    stack = data['self']['chips']
    # print('stack= ', stack)
    hand_cards = [Card.new(x[0] + x[1].lower()) for x in data['self']['cards']]
    # print('hand_cards= ', hand_cards)
    # print('community_card= ',community_card)

    cards = transferCard(hand_cards + community_card)
    # print('cards= ',cards)
    to_call = data['self']['minBet']
    # print('to_call= ',to_call)
    if len(community_card) == 0:
        handrank = -1
    else:
        handrank = Evaluator().evaluate(community_card, hand_cards)
    # print('handrank= ',handrank)
    betting = data['self']['bet']
    # print('betting= ',betting)
    totalpot = betting
    for player in data['game']['players']:
        totalpot += player['bet']
    # print('totalpot= ',totalpot)
    return np.concatenate(([totalpot, handrank], cards))
示例#23
0
 def __init__(self, strategy=None, desiredCards=None):
     self.strategy = strategy
     self.desiredCards = ([
         Card.print_pretty_card(Card.new(card)) if len(card) > 1 else card
         for card in desiredCards
     ] if desiredCards else None)
     self.POKER_HAND_EVALUATOR = Evaluator()
示例#24
0
def get_winner():
    parameters = request.get_json()
    player_list = parameters['players']
    round_id = parameters['round_id']

    evaluator = Evaluator()


    if player_list is not None:
        try:
            round_cards = get_round_cards(round_id)
            player_hands = get_player_hands(player_list, round_id)            
            player_hands_score = get_hands_score(player_hands, round_cards)
            winner = get_round_winner(player_hands_score)
         
            return jsonify({
                'player_id': winner['player_id']
            }), 200
        except Exception as e:
            return jsonify({
                'message': str(e)
            }), 400
    else:
        return jsonify({
            "message": "Não conseguiu pegar o vencedor"
        }),400
示例#25
0
文件: table.py 项目: PhDChe/pokerenv
 def __init__(self, n_players, agents, seed, stack_low=50, stack_high=200, hand_history_location='hands/', invalid_action_penalty=-5):
     self.hand_history_location = hand_history_location
     self.hand_history_enabled = False
     self.stack_low = stack_low
     self.stack_high = stack_high
     self.rng = np.random.default_rng(seed)
     self.n_players = n_players
     self.pot = 0
     self.bet_to_match = 0
     self.minimum_raise = 0
     self.street = GameState.PREFLOP
     self.cards = []
     self.deck = Deck()
     self.players = [Player(n+1, agents[n], 'player_%d' % n, invalid_action_penalty) for n in range(n_players)]
     self.active_players = n_players
     self.evaluator = Evaluator()
     self.history = []
示例#26
0
 def __init__(self, state, pool, hero):
     self.state = state
     self.dealt_to_str = 'Dealt to '
     self.hand_str = ''
     self.hole_cards_str = '*** HOLE CARDS ***\n'
     self.time = datetime.today().strftime('%Y/%m/%d/%H:%M:%S')
     self.header = 'PokerStars Hand #' + str(random.randint(0,100000000)) \
         + ': Tournament #40000000000, ' \
         + ' $10 + $0 USD Hold\'em  No Limit - Level I (10/20) - ' \
         + self.time + ' CET ' + '[' + self.time + ' ET]' + '\n' \
         + 'Table \'300000000 1\' 2-max ' \
         + 'Seat #1 is the button \n'
     self.small_blind_str = ': posts small blind 10 \n'
     self.big_blind_str = ': posts big blind 20 \n'
     self.total = 0
     self.preflop_history_str = ''
     self.flop_history_str = ''
     self.turn_history_str = ''
     self.river_history_str = ''
     self.flop_str = ''
     self.turn_str = ''
     self.river_str = ''
     self.flop_board_str = ''
     self.turn_board_str = ''
     self.flop_and_turn_board_str = ''
     self.river_board_str = ''
     self.final_board_str = ''
     self.showdown_str = ''
     self.summary = ''
     self.seat_1_str = 'Seat 1: '
     self.seat_2_str = 'Seat 2: '
     self.seat_1_hand = ''
     self.seat_2_hand = ''
     self.return_bet = 0
     self.seat_1_score_name = ''
     self.seat_2_score_name = ''
     self.invested_chips_seat_1 = 0
     self.invested_chips_seat_2 = 0
     self.showdown = False
     self.winner = None
     self.pool = pool
     self.hero = hero
     self.evaluator = Evaluator()
     self.hand_ranks = pd.read_csv('files//hand_rank_names.csv',
                                   skiprows=0,
                                   delimiter=':')
示例#27
0
 def __init__(self, cards, playerID, event, evaluation=None):
     self.evaluator = Evaluator()
     self.hand = cards
     self.create_cards_for_game(
     )  # Remaining cards after dealt two hole cards to this player. 15/02: This is updated after he in instantiated
     self.make_combinations(
     )  # all possible card permuations (1326) used to describe opponents range
     self.official_board = []
     self.summary = None
     self.evaluation = None
     self.rc = None
     self.score_desc = None
     self.hand_strength = None
     self.event = event
     self.playerID = playerID  # player name
     self.flop_cards, self.turn_card, self.river_card = None, None, None
     self.board = None  # Fictional board
示例#28
0
def odds(hand, board, num_players):
    my_hand = [Card.new(hand[0]), Card.new(hand[1])]
    remove_cards = [Card.new(hand[0]), Card.new(hand[1])]

    my_board = []

    for i in range(len(board)):
        import sys
        print(board, file=sys.stderr)
        try:
            my_board.append(Card.new(board[i]))
            remove_cards.append(Card.new(board[i]))
        except KeyError as e:
            print("BAD!!!", file=sys.stderr)
            exit()

    my_deck = Deck()

    for i in range(len(remove_cards)):
        my_deck.cards.remove(remove_cards[i])

    my_players = [my_hand]
    evaluator = Evaluator()

    count = 0
    for b in range(1000):
        deck = Deck()
        cards = my_deck.cards.copy()
        rshuffle(cards)
        deck.cards = cards

        players = my_players.copy()
        for j in range(num_players - 1):
            players.append(deck.draw(2))

        board = my_board.copy()
        while len(board) < 5:
            board.append(deck.draw(1))

        if evaluator.hand_summary(board, players) == 0:
            count += 1

    return count / 1000
示例#29
0
    def __init__(self,
                 server_uri,
                 name,
                 model,
                 debug=False,
                 playing_live=False):
        self._server_uri = server_uri
        self._debug = debug
        self._playing_live = playing_live

        # Conncetion Setting
        self.ws = ""
        self._name = str(hashlib.md5(name.encode('utf-8')).hexdigest())
        self._nick_name = name

        # model setting
        self._model = model
        self._room_id = "217"  # tableNumber

        # community_information
        self._round = 0
        self._button = 0
        self._smallblind = 0
        self._bigblind = 0

        self._tableNumber = ""

        self._cycle = 1
        self._evaluator = Evaluator()

        self.community = []
        self._discard = []  # Not used here, can not get the informatiom

        self._current_sidepot = 0  # index of _side_pots
        self._totalpot = 0
        self._tocall = 0
        self._lastraise = 0
        self._last_player = None
        self._last_action = None

        self.player_cnt = 0
        self.bet_table = {}
        self.round_bet_table = {}
        self.round_bet = 0

        #  player_information
        self.n_seats = 10
        self.emptyseats = self.n_seats

        self._side_pots = [0] * self.n_seats
        self._seats = self._seats = [
            Player(i, stack=0, emptyplayer=True) for i in range(self.n_seats)
        ]
        self._player_dict = {}
        self._current_player = None
示例#30
0
 def __init__(self):
     self.information_abstracter = InformationAbstracter()
     self.action_abstracter = ActionAbstracter()
     self.rotation_dict = {
         "p1": 0,
         "p2": 1,
         "p3": 2,
         "p4": 3,
         "p5": 4,
         "p6": 5
     }
     self.finalRound = ""
     self.evaluator = Evaluator()
     self.p1_final_stack = 0
     self.traverser_stacks = {}
     self.tree = {}
     self.file_path = ""
     with open("cardMap.dict", "rb") as file:
         self.cardMap = pickle.loads(file.read())
         file.close()