/
Notes.txt
executable file
·41 lines (32 loc) · 1.15 KB
/
Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Reference Link -
https://www.learndatasci.com/tutorials/reinforcement-q-learning-scratch-python-openai-gym/
Git Link -
https://github.com/Not-Yeshwanth-Reddy/AI
Reward Function -
High reward if it reaches the win block
slight negative reward if it doesn't reach the win block in time step
#Panality if it doesnot cover all the checkpoints
if key == 0:
playerObj.move(0, st.playerLength) # move down
if key == 1:
playerObj.move(st.playerLength, 0) # move right
if key == 2:
playerObj.move(0, -st.playerLength) # move up
if key == 3:
playerObj.move(-st.playerLength, 0) # move left
State Space -
Total no of states (20x15) - 300
Action Space -
Total No of Actions (N,S,E,W) - 4
not-yeshwanth-reddy@tech-book:~/Documents/Sem6/Artificial Intelegence/Wall-e/AI$ python2
Python 2.7.16 (default, Apr 6 2019, 01:42:57)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import numpy as np
qt = np.load("qt3.npy")
#loads the numpy array from file into the variable
qt[3,:]
#array([0., 0., 0., 0.])
qt[3,:]
np.save("qt.npy", qt)
#saves the array into .npy file.