Advertisement
nekosune

Untitled

Mar 18th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. # grid format:
  2. # 0 = navigable space
  3. # 1 = occupied space
  4. grid = [[1, 1, 1, 0, 0, 0],
  5. [1, 1, 1, 0, 1, 0],
  6. [0, 0, 0, 0, 0, 0],
  7. [1, 1, 1, 0, 1, 1],
  8. [1, 1, 1, 0, 1, 1]]
  9. goal = [2, 0] # final position
  10. init = [4, 3, 0] # first 2 elements are coordinates, third is direction
  11. cost = [2, 1, 20] # the cost field has 3 values: right turn, no turn, left turn
  12.  
  13. Answer:
  14. [' ', ' ', ' ', 'R', '#', 'R']
  15. [' ', ' ', ' ', '#', ' ', '#']
  16. ['*', '#', '#', '#', '#', 'R']
  17. [' ', ' ', ' ', '#', ' ', ' ']
  18. [' ', ' ', ' ', '#', ' ', ' ']
  19. Policies:
  20. orientation: up
  21. [' ', ' ', ' ', 'R', 'R', 'L']
  22. [' ', ' ', ' ', '#', ' ', '#']
  23. ['*', 'L', 'L', '#', 'L', 'L']
  24. [' ', ' ', ' ', '#', ' ', ' ']
  25. [' ', ' ', ' ', '#', ' ', ' ']
  26. orientation: left
  27. [' ', ' ', ' ', 'L', '#', '#']
  28. [' ', ' ', ' ', 'R', ' ', 'L']
  29. ['*', '#', '#', '#', '#', '#']
  30. [' ', ' ', ' ', 'R', ' ', ' ']
  31. [' ', ' ', ' ', 'R', ' ', ' ']
  32. orientation: down
  33. [' ', ' ', ' ', '#', 'R', '#']
  34. [' ', ' ', ' ', '#', ' ', '#']
  35. ['*', 'R', 'R', 'R', 'R', 'R']
  36. [' ', ' ', ' ', ' ', ' ', ' ']
  37. [' ', ' ', ' ', ' ', ' ', ' ']
  38. orientation: right
  39. [' ', ' ', ' ', 'R', '#', 'R']
  40. [' ', ' ', ' ', 'R', ' ', 'R']
  41. ['*', '#', '#', 'L', '#', 'L']
  42. [' ', ' ', ' ', 'L', ' ', ' ']
  43. [' ', ' ', ' ', 'L', ' ', ' ']
  44. The thread 'MainThread' (0x1a28) has exited with code 0 (0x0).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement