rlskyjo.environment package

Submodules

rlskyjo.environment.skyjo_env module

class rlskyjo.environment.skyjo_env.SimpleSkyjoEnv(num_players=2, score_penalty: float = 2.0, observe_other_player_indirect: bool = False, mean_reward: float = 1.0, reward_refunded: float = 0.0)

Bases: pettingzoo.utils.env.AECEnv

action_space(agent)

part of the PettingZoo API action_space is Discrete(26):

0-11: place hand card to position 0-11 12-23: discard place hand card and reveal position 0-11 24: pick hand card from drawpile 25: pick hand card from discard pile

Args:

agent ([type]): [description]

Returns:

[type]: [description]

close() None

part of the PettingZoo API

metadata = {'is_parallelizable': False, 'name': 'skyjo', 'render.modes': ['human'], 'video.frames_per_second': 1}
observation_space(agent)
observations are:

(1,) lowest sum of players, calculated feature (1,) lowest number of unmasked cards of any player,

calculated feature

(15,) counts of cards past discard pile cards & open player cards,

calculated feature

(1,) top discard pile card (1,) current hand_card total: (19,)

if observe_other_player_indirect is True:

# constant for any num_players (12) own cards total: (31,)

elif observe_other_player_indirect is False:

(num_players*4*3,) total: (19+12*num_players,)

Args:

agent ([type]): agent string

Returns:

gym.space: observation_space of agent

observe(agent: str) Dict[str, numpy.ndarray]

get observation and action mask from environment part of the PettingZoo API]

Args:

agent ([str]): agent string

Returns:

dict: {“observations”: np.ndarray, “action_mask”: np.ndarray}

render(mode='human') None

render board of the game to stdout

part of the PettingZoo API

reset() None

reset the environment part of the PettingZoo API

seed(seed: Optional[int] = None) None

seed the environment. does not affect global np.random.seed() experimental. only works with Numba installed part of the PettingZoo API

Args:

seed (int, optional): [description]. Defaults to None.

step(action: int) None

part of the PettingZoo API

Args:
action (int):
action is number from 0-25:

0-11: place hand card to position 0-11 12-23: discard place hand card and reveal position 0-11 24: pick hand card from drawpile 25: pick hand card from discard pile

Returns:

None:

rlskyjo.environment.skyjo_env.env(**kwargs)

wrap SkyJoEnv in

rlskyjo.environment.vanilla_env_example module

rlskyjo.environment.vanilla_env_example.simple_episode(config, verbose=0)

create a vanilla example

Module contents