Created
June 3, 2018 09:01
-
-
Save pyliaorachel/0a432bf8bec8201fcef4e8202adbb9fb to your computer and use it in GitHub Desktop.
OpenAI Gym CartPole - Hand-made Policy (choose action)
This file contains hidden or 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
| # 定義 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