blackjack#

Classes#

Blackjack

Blackjack simulation class

CardDeck

For shuffling and dealing cards

class prt_sim.jhu.blackjack.Blackjack[source]#

Blackjack simulation class

execute_action(action: int) Tuple[int, float, bool][source]#

Executes the agent’s action and steps the simulation.

Parameters:

action (int) – Action to execute

Returns:

Next state, reward, done

Return type:

Tuple[int, float, bool]

get_number_of_actions() int[source]#

Returns the number of actions in the environment.

Returns:

number of actions

Return type:

int

get_number_of_states() int[source]#

Returns the number of states in the environment.

Returns:

number of states

Return type:

int

render()#

Renders the environment

reset(seed: int | None = None, randomize_start: bool | None = False) int[source]#

Resets the environment to the initial state.

Parameters:
  • seed (int, optional) – Random seed. Defaults to None.

  • randomize_start (bool, optional) – Whether to randomize the starting state. Not all environments will support this. Defaults to False.

Returns:

current state value

Return type:

int

class prt_sim.jhu.blackjack.CardDeck[source]#

For shuffling and dealing cards