@@ -57,8 +57,20 @@ def draw_image(image):
57
57
58
58
# Add cells
59
59
for (i , j ), val in np .ndenumerate (image ):
60
+
61
+ # add state labels
62
+ if [i , j ] == A_POS :
63
+ val = str (val ) + " (A)"
64
+ if [i , j ] == A_PRIME_POS :
65
+ val = str (val ) + " (A')"
66
+ if [i , j ] == B_POS :
67
+ val = str (val ) + " (B)"
68
+ if [i , j ] == B_PRIME_POS :
69
+ val = str (val ) + " (B')"
70
+
60
71
tb .add_cell (i , j , width , height , text = val ,
61
72
loc = 'center' , facecolor = 'white' )
73
+
62
74
63
75
# Row and column labels...
64
76
for i in range (len (image )):
@@ -88,6 +100,17 @@ def draw_policy(optimal_values):
88
100
val = ''
89
101
for ba in best_actions :
90
102
val += ACTIONS_FIGS [ba ]
103
+
104
+ # add state labels
105
+ if [i , j ] == A_POS :
106
+ val = str (val ) + " (A)"
107
+ if [i , j ] == A_PRIME_POS :
108
+ val = str (val ) + " (A')"
109
+ if [i , j ] == B_POS :
110
+ val = str (val ) + " (B)"
111
+ if [i , j ] == B_PRIME_POS :
112
+ val = str (val ) + " (B')"
113
+
91
114
tb .add_cell (i , j , width , height , text = val ,
92
115
loc = 'center' , facecolor = 'white' )
93
116
0 commit comments