Skip to content

Instantly share code, notes, and snippets.

@qgallouedec
Last active April 26, 2020 12:21
Show Gist options
  • Select an option

  • Save qgallouedec/e41b72b7dfa19f510b591dedc81dc062 to your computer and use it in GitHub Desktop.

Select an option

Save qgallouedec/e41b72b7dfa19f510b591dedc81dc062 to your computer and use it in GitHub Desktop.
# Defines the transition probabiliy kernel
P = np.zeros((nb_states, nb_actions, nb_states))
# P[state, action, next_state]
P[0,0,1] = P[1,0,2] = P[2,0,3] = 1 # go right
P[2,1,1] = P[1,1,0] = P[0,1,0] = 1 # go left
P[3,:,3] = 1 # State 3 is terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment