rlcard.games.nolimitholdem

rlcard.games.nolimitholdem.dealer

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

Bases: LimitHoldemDealer

rlcard.games.nolimitholdem.game

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

Bases: LimitHoldemGame

configure(game_config)

Specify some game specific parameters, such as number of players, initial chips, and dealer id. If dealer_id is None, he will be randomly chosen

Return the legal actions for current player

Returns:

A list of legal actions

Return type:

(list)

static get_num_actions()

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)

get_num_players()

Return the number of players in no limit texas holdem

Returns:

The number of players in the game

Return type:

(int)

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()

Initialize the game of not limit holdem

This version supports two-player no limit texas holdem

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 player 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(value)

Bases: 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: LimitHoldemJudger

rlcard.games.nolimitholdem.player

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

Bases: LimitHoldemPlayer

bet(chips)

rlcard.games.nolimitholdem.round

Implement no limit texas holdem Round class

class rlcard.games.nolimitholdem.round.Action(value)

Bases: Enum

An enumeration.

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

Bases: object

Round can call functions from other classes to keep the game running

Obtain the legal actions for the current 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 functions from other classes 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:
  • game_pointer (int) – The game_pointer that indicates the next player

  • raised (list) – Initialize the chips for each player

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