Skip to content

Instantly share code, notes, and snippets.

@PierreExeter
Created October 11, 2019 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PierreExeter/c3acde4cbf234a89c644add4b195f6a7 to your computer and use it in GitHub Desktop.
Save PierreExeter/c3acde4cbf234a89c644add4b195f6a7 to your computer and use it in GitHub Desktop.
import gym
import pybulletgym
env = gym.make('ReacherPyBulletEnv-v0')
env.render(mode="human")
for episode in range(20):
state = env.reset()
rewards = []
for t in range(30000):
env.render()
# action = env.action_space.sample()
action = [0.00001, 0]
print(action)
state, reward, done, info = env.step(action)
rewards.append(reward)
cumulative_reward = sum(rewards)
print("episode {} | cumulative reward : {}".format(episode, cumulative_reward))
env.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment