a collection of environments for the OpenAI Gym
current environments:
- Blackjack-v0
all the environments are registered with the gym when you import gymn_nastics
This is not in pip/pypi yet. Sorry. The easiest way will be to add a subdirectory into your project called gym_nastics
by downloading the zip here and extracting it or adding a git submodule.
- currently a single, freshly shuffled 52 card deck is used each episode/game
- supports actions Hit (
0
) and Stand (1
) - observation is
Tuple(Discrete(11),Discrete(11))
- you only get a
reward
whendone==True
- your
reward
will be the score of your hand if you beat the dealer and didn't bust - the players opening hand will never be a blackjack, those hands require no decisions
- Splitting and Betting are not supported (yet?)
in some trial runs a version of cem.py
scored a 100 episode mean of 10.05
(after episode #639,900)
from __future__ import print_function
import gym
import gym_nastics
# environments are registered upon import
# Support python 2 and 3
try: range = xrange
except NameError: pass
env = gym.make('Blackjack-v0')
for i_episode in range(20):
observation = env.reset()
env.render()
for t in range(100):
action = env.action_space.sample()
observation, reward, done, info = env.step(action)
env.render()
if done:
print("Episode finished after {} timesteps\n".format(t + 1))
break