Skip to content

Instantly share code, notes, and snippets.

@pyliaorachel
Created June 3, 2018 09:01
Show Gist options
  • Select an option

  • Save pyliaorachel/0a432bf8bec8201fcef4e8202adbb9fb to your computer and use it in GitHub Desktop.

Select an option

Save pyliaorachel/0a432bf8bec8201fcef4e8202adbb9fb to your computer and use it in GitHub Desktop.
OpenAI Gym CartPole - Hand-made Policy (choose action)
# 定義 policy
def choose_action(observation):
pos, v, ang, rot = observation
return 0 if ang < 0 else 1 # 柱子左傾則小車左移,否則右移
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment