Skip to content

Commit

Permalink
fix KellyCoinFlipGeneralizedTest (sample from action_space after seed…
Browse files Browse the repository at this point in the history
… and reset, as action dimensions in it are also random)
  • Loading branch information
pzhokhov committed Jan 30, 2019
1 parent 6497c9f commit 4ceff7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gym/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from gym.utils import reraise
from gym.version import VERSION as __version__

from gym.core import Env, GoalEnv, Space, Wrapper, ObservationWrapper, ActionWrapper, RewardWrapper
from gym.core import Env, GoalEnv, Wrapper, ObservationWrapper, ActionWrapper, RewardWrapper
from gym.spaces import Space
from gym.envs import make, spec, register
from gym import logger

Expand Down
4 changes: 2 additions & 2 deletions gym/envs/tests/test_determinism.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ def test_env(spec):
# due to some environments.
env1 = spec.make()
env1.seed(0)
initial_observation1 = env1.reset()
env1.action_space.seed(0)
action_samples1 = [env1.action_space.sample() for i in range(4)]
initial_observation1 = env1.reset()
step_responses1 = [env1.step(action) for action in action_samples1]
env1.close()

env2 = spec.make()
env2.seed(0)
initial_observation2 = env2.reset()
env2.action_space.seed(0)
action_samples2 = [env2.action_space.sample() for i in range(4)]
initial_observation2 = env2.reset()
step_responses2 = [env2.step(action) for action in action_samples2]
env2.close()

Expand Down

0 comments on commit 4ceff7d

Please sign in to comment.