Created
October 11, 2019 11:42
-
-
Save PierreExeter/c3acde4cbf234a89c644add4b195f6a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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