-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbasic.py
More file actions
67 lines (57 loc) · 2.47 KB
/
basic.py
File metadata and controls
67 lines (57 loc) · 2.47 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
def MDPQuestion1(sVal):
if sVal == "EESSS":
print('Correct')
print(' SENESSS took too many steps')
print(' SEESS missed out on a +1 reward')
elif sVal == "SENESSS":
print('You took too many steps! Remember there is a negative time reward')
else:
print('Incorrect. Remember to collect as many rewards in as few moves as possible')
def MDPQuestion2(iVal):
if iVal == 12:
print('Correct')
print(' These could be stored in a 1 x 12 array')
else:
print('Incorrect. Count the spaces. You have a 3x4 grid')
def MDPQuestion3(iVal):
if iVal == 4:
print('Correct')
print(' N, E, S, and W for the cardinal directions')
else:
print('Incorrect. How many directions can you move?')
def MDPQuestion4(iVal):
if iVal == 1:
print('Correct')
print(' If you select E you will move to the state to the right 100% of the time. Had this been a stochastic process you would need to account for that.')
else:
print('Incorrect. Where do you end up if you move right?')
def MDPQuestion5(iVal):
if iVal == 0:
print('Correct')
print(' That action runs you into a wall and will not move to the state to the east')
else:
print('Incorrect. How can you move to the East by going North?')
def MDPQuestion6(iVal):
if iVal == 1:
print('Correct')
print(' You pick up the reward in that state when you enter it')
else:
print('Incorrect. What is the reward value of cell (2,0)?')
def MDPQuestion7(iVal):
if iVal == -1:
print('Correct')
print(' You pick up the reward in that state when you enter it')
else:
print('Incorrect. What is the reward value of cell (0,2)?')
def VIQuestion1(iVal):
if iVal == 8.1:
print('Correct')
print(' You need to grab the current reward (0) and add that to the product of the discount factor (0.9) times the future reward (9)')
else:
print('Incorrect: You need the current reward (0) and then add that to the discount factor (0.9) times the future reward (9)')
def VIQuestion2(iVal):
if iVal == 9.9:
print('Correct')
print(' You need to grab the current reward (9) and add that to the product of the discount factor (0.9) times the future reward (10)')
else:
print('Incorrect: You need the current reward (9) and then add that to the discount factor (0.9) times the future reward (10)')