summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-11-01 14:58:06 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-11-01 14:58:06 +0100
commita417a3054c1ce54a5ff2866848797c1610f2202d (patch)
tree9949f574a55df222857ba1dc53ce5270894611e6
parentb3b8478a9cd1799cfa73c864ac994c5d54a78369 (diff)
Minor changes
-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))