Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.05 KB | None | 0 0
  1. import math
  2. import numpy as np
  3.  
  4. X = {1,2,3,4,5,6}
  5. A = {"Up","Down","Right","Left"}
  6.  
  7.      
  8. Pup=np.array([[0.8, 0.1,   0, 0.1,   0,   0],  
  9.             [  0.1, 0.7, 0.1,   0, 0.1,   0],    
  10.             [    0, 0.1, 0.8,   0,   0, 0.1],    
  11.             [  0.6,   0,   0, 0.3, 0.1,   0],    
  12.             [    0, 0.6,   0, 0.1, 0.2, 0.1],  
  13.             [    0,   0, 0.6,   0, 0.1, 0.3],  
  14.            ])
  15.  
  16. Pdown=np.array([[0.3, 0.1,   0, 0.6,   0,   0],  #1
  17.             [    0.1, 0.2, 0.1,   0, 0.6,   0],  #2
  18.             [      0, 0.1, 0.3,   0,   0, 0.6],  #3
  19.             [    0.1,   0,   0, 0.8, 0.1,   0],  #4
  20.             [      0, 0.1,   0, 0.1, 0.7, 0.1],  #5
  21.             [      0,   0, 0.1,   0, 0.1, 0.8],  #6
  22.            ])
  23.  
  24. Pright=np.array([[0.3, 0.6,   0, 0.1,   0,   0],  #1
  25.             [     0.1, 0.2, 0.6,   0, 0.1,   0],  #2
  26.             [       0, 0.1, 0.8,   0,   0, 0.1],  #3
  27.             [     0.1,   0,   0, 0.3, 0.6,   0],  #4
  28.             [       0, 0.1,   0, 0.1, 0.2, 0.6],  #5
  29.             [       0,   0, 0.1,   0, 0.1, 0.8],  #6
  30.            ])
  31.  
  32. Pleft=np.array([[0.8, 0.1,   0, 0.1,   0,   0],  #1
  33.             [    0.6, 0.2, 0.1,   0, 0.1,   0],  #2
  34.             [      0, 0.6, 0.3,   0,   0, 0.1],  #3
  35.             [    0.1,   0,   0, 0.8, 0.1,   0],  #4
  36.             [      0, 0.1,   0, 0.6, 0.2, 0.1],  #5
  37.             [      0,   0, 0.1,   0, 0.6, 0.3],  #6
  38.            ])
  39.             #   UP   DOWN   RIGHT  LEFT
  40. C = np.array([[0.15, 0.15, 0.15, 0.15],  #1
  41.             [  0.15,    1, 0.15, 0.15],  #2
  42.             [  0.15,    0, 0.15, 0.15],  #3
  43.             [  0.15, 0.15,    1, 0.15],  #4
  44.             [  0.15,    1, 0.15, 0.15],  #5
  45.             [  0.15,    0,    0,    1],  #6
  46.            ])# Insert your code here
  47.                        
  48. print("State List: \n", X)
  49.                        
  50. print("Action List: \n", A)
  51.                        
  52. print("Transition UP: \n", Pup)
  53. print("Transition DOWN: \n", Pdown)
  54. print("Transition RIGHT: \n", Pright)
  55. print("Transition LEFT: \n", Pleft)
  56.                        
  57. print("Cost Matrix: \n", C)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement