rlcard.games.nolimitholdem

rlcard.games.nolimitholdem.dealer

class rlcard.games.nolimitholdem.dealer.NolimitholdemDealer(np_random)

Bases: rlcard.games.limitholdem.dealer.LimitholdemDealer

rlcard.games.nolimitholdem.game

class rlcard.games.nolimitholdem.game.NolimitholdemGame(allow_step_back=False, num_players=2)

Bases: rlcard.games.limitholdem.game.LimitholdemGame

static get_action_num()

Return the number of applicable actions

Returns

The number of actions. There are 6 actions (call, raise_half_pot, raise_pot, all_in, check and fold)

Return type

(int)

Return the legal actions for current player

Returns

A list of legal actions

Return type

(list)

get_payoffs()

Return the payoffs of the game

Returns

Each entry corresponds to the payoff of one player

Return type

(list)

get_state(player_id)

Return player’s state

Parameters

player_id (int) – player id

Returns

The state of the player

Return type

(dict)

init_game()

Initialilze the game of Limit Texas Hold’em

This version supports two-player limit texas hold’em

Returns

Tuple containing:

(dict): The first state of the game (int): Current player’s id

Return type

(tuple)

step(action)

Get the next state

Parameters

action (str) – a specific action. (call, raise, fold, or check)

Returns

Tuple containing:

(dict): next player’s state (int): next plater’s id

Return type

(tuple)

step_back()

Return to the previous state of the game

Returns

True if the game steps back successfully

Return type

(bool)

class rlcard.games.nolimitholdem.game.Stage

Bases: enum.Enum

An enumeration.

END_HIDDEN = 4
FLOP = 1
PREFLOP = 0
RIVER = 3
SHOWDOWN = 5
TURN = 2

rlcard.games.nolimitholdem.judger

class rlcard.games.nolimitholdem.judger.NolimitholdemJudger(np_random)

Bases: rlcard.games.limitholdem.judger.LimitholdemJudger

The Judger class for Texas Hold’em

rlcard.games.nolimitholdem.player

class rlcard.games.nolimitholdem.player.NolimitholdemPlayer(player_id, init_chips, np_random)

Bases: rlcard.games.limitholdem.player.LimitholdemPlayer

bet(chips)

rlcard.games.nolimitholdem.round

Implement NoLimit Texas Hold’em Round class

class rlcard.games.nolimitholdem.round.Action

Bases: enum.Enum

An enumeration.

ALL_IN = 5
CALL = 2
CHECK = 1
FOLD = 0
RAISE_HALF_POT = 3
RAISE_POT = 4
class rlcard.games.nolimitholdem.round.NolimitholdemRound(num_players, init_raise_amount, dealer, np_random)

Bases: object

Round can call other Classes’ functions to keep the game running

Obtain the legal actions for the curent player

Parameters

players (list) – The players in the game

Returns

A list of legal actions

Return type

(list)

is_over()

Check whether the round is over

Returns

True if the current round is over

Return type

(boolean)

proceed_round(players, action)

Call other Classes’s functions to keep one round running

Parameters
  • players (list) – The list of players that play the game

  • action (str/int) – An legal action taken by the player

Returns

The game_pointer that indicates the next player

Return type

(int)

start_new_round(game_pointer, raised=None)

Start a new bidding round

Parameters

raised (list) – Initialize the chips for each player

Note: For the first round of the game, we need to setup the big/small blind