Skip to content

Instantly share code, notes, and snippets.

@WhatIThinkAbout
Last active January 7, 2023 14:32
Show Gist options
  • Select an option

  • Save WhatIThinkAbout/73c3b65a17ca5dfed629191fac9248ac to your computer and use it in GitHub Desktop.

Select an option

Save WhatIThinkAbout/73c3b65a17ca5dfed629191fac9248ac to your computer and use it in GitHub Desktop.
# run the environment, taking random actions
env.reset()
info = {}
terminated = False
while not terminated:
# choose a random action
action = env.action_space.sample()
# take the action and get the information from the environment
new_state, reward, terminated, truncated, info = env.step(action)
# form an information string
info_str = f"{Actions(action): <5}: {new_state} reward = {reward}"
# show the current position and reward
env.render(info = {'side_info': [((10,10),info_str)]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment