roomai.kuhn package

Submodules

roomai.kuhn.KuhnPokerEnv module

class roomai.kuhn.KuhnPokerEnv.KuhnPokerEnv[source]

Bases: roomai.common.common.AbstractEnv

The KuhnPoker game environment

classmethod compete(env, players)[source]

Use the game environment to hold a compete for the players

Parameters:
  • env – The game environment
  • players – The players
Returns:

scores for the players

forward(action)[source]

The KuhnPoker game environment steps with the action taken by the current player

:param action :returns:infos, public_state, person_states, private_state

init(params={})[source]

Initialize the KuhnPoker game environment

Parameters:params – the initialization params
Returns:infos, public_state, person_states, private_state

roomai.kuhn.KuhnPokerPlayer module

class roomai.kuhn.KuhnPokerPlayer.KuhnPokerAlwaysBetPlayer[source]

Bases: roomai.common.common.AbstractPlayer

receive_info(info)[source]
reset()[source]
take_action()[source]
class roomai.kuhn.KuhnPokerPlayer.KuhnPokerRandomPlayer[source]

Bases: roomai.common.common.AbstractPlayer

receive_info(info)[source]
reset()[source]
take_action()[source]

roomai.kuhn.KuhnPokerUtils module

class roomai.kuhn.KuhnPokerUtils.KuhnPokerAction(key)[source]

Bases: roomai.common.common.AbstractAction

The KuhnPoker action. There are only two actions: bet and check. Examples of usages:

>> import roomai.kuhn

>> action = roomai.kuhn.KuhnPokerAction.lookup(“bet”)

>> action.key

“bet”

>> action = roomai.kuhn.KuhnPokerAction.lookup(“check”)

>> action.key

“check”

key

The key of the KuhnPoker action, “bet” or “check”.

classmethod lookup(key)[source]
class roomai.kuhn.KuhnPokerUtils.KuhnPokerPersonState[source]

Bases: roomai.common.common.AbstractPersonState

The person state of KuhnPoker

number

The number given by the game enviroment. The value of this number is in {0,1,2}. The larger number, the higher win rate

class roomai.kuhn.KuhnPokerUtils.KuhnPokerPrivateState[source]

Bases: roomai.common.common.AbstractPrivateState

The private state class of KuhnPoker

class roomai.kuhn.KuhnPokerUtils.KuhnPokerPublicState[source]

Bases: roomai.common.common.AbstractPublicState

The public state class of the KuhnPoker game

action_list

the action history taken by the players

epoch
first

players[first] is expected to take an action

Module contents