8000 Off-by-one error in `gym_pendulum` · Issue #6 · WilsonWangTHU/mbbl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Off-by-one error in gym_pendulum #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bamos opened this issue Jan 26, 2020 · 0 comments
Open

Off-by-one error in gym_pendulum #6

bamos opened this issue Jan 26, 2020 · 0 comments

Comments

@bamos
Copy link
bamos commented Jan 26, 2020

Hi, just a minor issue here. The gym_pendulum environment in here runs for 201 steps instead of 200 steps as the original gym pendulum does and I think it's because this line should be an inequality.

Code to see this issue

#!/usr/bin/env python3

import gym
from mbbl.env.env_register import make_env

env = gym.make('Pendulum-v0')
env.reset()

done = False
t = 0
while not done:
    obs, reward, done, _ = env.step(env.action_space.sample())
    t += 1

print(f'Gym Pendulum-v0: {t} steps')

env, _ = make_env('gym_pendulum', rand_seed=0)
env.reset()

done = False
t = 0
while not done:
    obs, reward, done, _ = env.step(env._env.action_space.sample())
    t += 1

print(f'mbbl pendulum: {t} steps')

Output

Gym Pendulum-v0: 200 steps
mbbl pendulum: 201 steps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0