You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 lines
2.9 KiB

  1. // maze example (POMDP)
  2. // slightly extends that presented in
  3. // Littman, Cassandra and Kaelbling
  4. // Learning policies for partially observable environments: Scaling up
  5. // Technical Report CS, Brown University
  6. // gxn 29/01/16
  7. // state space (value of variable "s")
  8. // 0 1 2 3 4
  9. // 5 6 7
  10. // 8 9 10
  11. // 11 13 12
  12. // 13 is the target
  13. pomdp
  14. // can observe the walls and target
  15. observables
  16. o
  17. endobservables
  18. // o=0 - observation in initial state
  19. // o=1 - west and north walls (s0)
  20. // o=2 - north and south ways (s1 and s3)
  21. // o=3 - north wall (s2)
  22. // o=4 - east and north way (s4)
  23. // o=5 - east and west walls (s5, s6, s7, s8, s9 and s10)
  24. // o=6 - east, west and south walls (s11 and s12)
  25. // o=7 - the target (s13)
  26. module maze
  27. s : [-1..13];
  28. o : [0..7];
  29. // initialisation
  30. [] s=-1 -> 1/13 : (s'=0) & (o'=1)
  31. + 1/13 : (s'=1) & (o'=2)
  32. + 1/13 : (s'=2) & (o'=3)
  33. + 1/13 : (s'=3) & (o'=2)
  34. + 1/13 : (s'=4) & (o'=4)
  35. + 1/13 : (s'=5) & (o'=5)
  36. + 1/13 : (s'=6) & (o'=5)
  37. + 1/13 : (s'=7) & (o'=5)
  38. + 1/13 : (s'=8) & (o'=5)
  39. + 1/13 : (s'=9) & (o'=5)
  40. + 1/13 : (s'=10) & (o'=5)
  41. + 1/13 : (s'=11) & (o'=6)
  42. + 1/13 : (s'=12) & (o'=6);
  43. // moving around the maze
  44. [east] s=0 -> (s'=1) & (o'=2);
  45. [west] s=0 -> (s'=0);
  46. [north] s=0 -> (s'=0);
  47. [south] s=0 -> (s'=5) & (o'=5);
  48. [east] s=1 -> (s'=2) & (o'=3);
  49. [west] s=1 -> (s'=0) & (o'=1);
  50. [north] s=1 -> (s'=1);
  51. [south] s=1 -> (s'=1);
  52. [east] s=2 -> (s'=3) & (o'=2);
  53. [west] s=2 -> (s'=1) & (o'=2);
  54. [north] s=2 -> (s'=2);
  55. [south] s=2 -> (s'=6) & (o'=5);
  56. [east] s=3 -> (s'=4) & (o'=4);
  57. [west] s=3 -> (s'=2) & (o'=2);
  58. [north] s=3 -> (s'=3);
  59. [south] s=3 -> (s'=3);
  60. [east] s=4 -> (s'=4);
  61. [west] s=4 -> (s'=3) & (o'=2);
  62. [north] s=4 -> (s'=4);
  63. [south] s=4 -> (s'=7) & (o'=5);
  64. [east] s=5 -> (s'=5);
  65. [west] s=5 -> (s'=5);
  66. [north] s=5 -> (s'=0) & (o'=1);
  67. [south] s=5 -> (s'=8);
  68. [east] s=6 -> (s'=6);
  69. [west] s=6 -> (s'=6);
  70. [north] s=6 -> (s'=2) & (o'=3);
  71. [south] s=6 -> (s'=9);
  72. [east] s=7 -> (s'=7);
  73. [west] s=7 -> (s'=7);
  74. [north] s=7 -> (s'=4) & (o'=4);
  75. [south] s=7 -> (s'=10);
  76. [east] s=8 -> (s'=8);
  77. [west] s=8 -> (s'=8);
  78. [north] s=8 -> (s'=5);
  79. [south] s=8 -> (s'=11) & (o'=6);
  80. [east] s=9 -> (s'=9);
  81. [west] s=9 -> (s'=9);
  82. [north] s=9 -> (s'=6);
  83. [south] s=9 -> (s'=13) & (o'=7);
  84. [east] s=10 -> (s'=9);
  85. [west] s=10 -> (s'=9);
  86. [north] s=10 -> (s'=7);
  87. [south] s=10 -> (s'=12) & (o'=6);
  88. [east] s=11 -> (s'=11);
  89. [west] s=11 -> (s'=11);
  90. [north] s=11 -> (s'=8) & (o'=5);
  91. [south] s=11 -> (s'=11);
  92. [east] s=12 -> (s'=12);
  93. [west] s=12 -> (s'=12);
  94. [north] s=12 -> (s'=10) & (o'=5);
  95. [south] s=12 -> (s'=12);
  96. // loop when we reach the target
  97. [done] s=13 -> true;
  98. endmodule
  99. // reward structure (number of steps to reach the target)
  100. rewards
  101. [east] true : 1;
  102. [west] true : 1;
  103. [north] true : 1;
  104. [south] true : 1;
  105. endrewards
  106. // target observation
  107. label "goal" = o=7;