Guest User

Untitled

a guest
Oct 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. transitionMatrix = np.matrix([[0, 0, 0, 0, 0, 1, 0, 1, 0, 0],
  2. [0, 0, 0, 0, 0, 0, 1, 0, 1, 0],
  3. [0, 0, 0, 1, 0, 0, 0, 1, 0, 0],
  4. [0, 0, 1, 0, 0, 0, 0, 0, 1, 1],
  5. [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  6. [1, 0, 0, 0, 0, 0, 1, 0, 0, 1],
  7. [0, 1, 0, 0, 0, 1, 0, 0, 0, 0],
  8. [1, 0, 1, 0, 0, 0, 0, 0, 0, 0],
  9. [0, 1, 0, 1, 0, 0, 0, 0, 0, 0],
  10. [0, 0, 0, 1, 0, 1, 0, 0, 0, 0]])
  11.  
  12. stateVector = np.matrix([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
  13.  
  14. nextState = np.matmul(stateVector,transitionMatrix)
  15.  
  16. nextState # order: 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 - I am aware it doesn't start with 0
  17. # matrix([[0, 0, 0, 0, 0, 1, 0, 1, 0, 0]])
Add Comment
Please, Sign In to add comment