Guest User

Untitled

a guest
Jul 16th, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 2.24 KB | None | 0 0
  1. % ---------------------------------------------------------------------
  2.  
  3. %  ----- Informatics 2D - 2011/12 - Second Assignment - Planning -----
  4.  
  5. % ---------------------------------------------------------------------
  6.  
  7. %
  8.  
  9. % Write here you matriculation number (only - your name is not needed)
  10.  
  11. % Matriculation Number: s0932205
  12.  
  13. %
  14.  
  15. %
  16.  
  17. % ------------------------- Problem Instance --------------------------
  18.  
  19. % This file is a template for a problem instance: the definition of an
  20.  
  21. % initial state and of a goal.
  22.  
  23.  
  24.  
  25. % debug(on).    % need additional debug information at runtime?
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. % --- Load domain definitions from an external file -------------------
  34.  
  35.  
  36.  
  37. :- [domain-task2].      % Replace with the domain for this problem
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. % --- Definition of the initial state ---------------------------------
  48.  
  49.  
  50.  
  51. at(a,loc3-2,s0). % initial locations of blocks and agent
  52.  
  53. at(cA,loc2-3,s0).
  54.  
  55. at(cB,loc2-2,s0).
  56.  
  57. at(cC,loc2-1,s0).
  58.  
  59. agent(a). % a is an agent
  60. crate(cA). % cA, cB, cC are crates
  61. crate(cB).
  62. crate(cC).
  63.  
  64.  
  65.  
  66. path(loc1-1,loc1-2,up). % paths
  67.  
  68. path(loc1-1,loc2-1,right).
  69.  
  70. path(loc1-2,loc1-1,down).
  71.  
  72. path(loc1-2,loc1-3,up).
  73.  
  74. path(loc1-2,loc2-2,right).
  75.  
  76. path(loc1-3,loc1-2,down).
  77.  
  78. path(loc1-3,loc1-4,up).
  79.  
  80. path(loc1-3,loc2-3,right).
  81.  
  82. path(loc1-4,loc1-3,down).
  83.  
  84. path(loc1-4,loc2-4,right).
  85.  
  86. path(loc2-1,loc1-1,left).
  87.  
  88. path(loc2-1,loc3-1,right).
  89.  
  90. path(loc2-1,loc2-2,up).
  91.  
  92. path(loc2-2,loc2-1,down).
  93.  
  94. path(loc2-2,loc1-2,left).
  95.  
  96. path(loc2-2,loc2-3,up).
  97.  
  98. path(loc2-2,loc3-2,right).
  99.  
  100. path(loc2-3,loc2-2,down).
  101.  
  102. path(loc2-3,loc1-3,left).
  103.  
  104. path(loc2-3,loc2-4,up).
  105.  
  106. path(loc2-3,loc3-3,right).
  107.  
  108. path(loc2-4,loc2-3,down).
  109.  
  110. path(loc2-4,loc1-4,left).
  111.  
  112. path(loc3-1,loc2-1,left).
  113.  
  114. path(loc3-1,loc3-2,up).
  115.  
  116. path(loc3-2,loc3-1,down).
  117.  
  118. path(loc3-2,loc2-2,left).
  119.  
  120. path(loc3-2,loc3-3,up).
  121.  
  122. path(loc3-3,loc3-2,down).
  123.  
  124. path(loc3-3,loc2-3,left).
  125.  
  126.  
  127.  
  128.  
  129.  
  130. % --- Goal condition that the planner will try to reach ---------------
  131.  
  132.  
  133.  
  134. goal(S) :-                  % fill in the goal definition
  135.  
  136.     at(cA,loc1-2,S),
  137.  
  138.     at(cB,loc1-3,S),
  139.  
  140.     at(cC,loc1-1,S).
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148. % ---------------------------------------------------------------------
  149.  
  150. % ---------------------------------------------------------------------
Add Comment
Please, Sign In to add comment