summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xqlearning.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/qlearning.py b/qlearning.py
index 2273b7e..797e2a9 100755
--- a/qlearning.py
+++ b/qlearning.py
@@ -24,6 +24,8 @@ from snake import Snake
##### Totally 12 boolean features so 2^12=4096 states
##### Totally 4 actions for the AI (up, right,down,left)
##### Totally 4*2^12 thus 16 384 table entries
+##### Reward +1 when eat an apple
+##### Reward -10 when hit obstacle
qtable=np.zeros((4096, 4))