-
-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Description
Bug found by @tetrapod54:
In this block, the variable i in for i in range(n) can be referred from outside of the for loop:
while i < max_iter and error > tol:
for i in range(n):
v_next[i] = np.max(mcm.state_action_values(i, v))
error = np.max(np.abs(v_next - v))
i += 1 # <- This is always equal to n
v[:] = v_nextTry this:
for i in range(5):
pass
print(i)You will get 4.
The index variable for the for loop (or that for the while loop) has to be something other than i.
shlff
Metadata
Metadata
Assignees
Labels
No labels