Advertisement
Guest User

প্পপ্প

a guest
Jun 24th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. (define (domain lightup)
  2. ; (:requirements :adl :strips)
  3. (:requirements :adl)
  4. (:types
  5. xpos ;; x positions in the grid *DO NOT REMOVE*
  6. ypos ;; y positions in the grid *DO NOT REMOVE*
  7. num ;; numbers from 0 to 4 to count the number of light bulbs
  8. )
  9.  
  10. (:predicates
  11. ; You may, or may not, use / modify / remove any one of the following
  12. ; predicates:
  13.  
  14. ;; n2 = n1 + 1
  15. (increment ?n1 ?n2 - num)
  16.  
  17. ;; (?x1, ?y1) is (horizontally or vertically) adjacent to (?x2, ?y2)
  18. (adjacent ?x - xpos ?y - ypos ?x2 - xpos ?y2 - ypos)
  19.  
  20. ;; ?x2 is right of ?x1
  21. (right ?x1 ?x2 - xpos)
  22.  
  23. ;; ?y2 is below of ?y1
  24. (below ?y1 ?y2 - ypos)
  25.  
  26. ;; cell (?x, ?y) is lit-up
  27. (lit ?x - xpos ?y - ypos)
  28.  
  29. ;; cell (?x, ?y) is black
  30. (black ?x - xpos ?y - ypos)
  31.  
  32. ;; ?n many light bulbs are vertically or horizontally adjacent to (?x, ?y)
  33. ;; (may be only defined for the relevant black cells)
  34. (surrounded ?x - xpos ?y - ypos ?n - num)
  35.  
  36.  
  37. (left ?x1 ?x2 - xpos)
  38. (up ?y1 ?y2 - ypos)
  39. )
  40.  
  41. (:action place-bulb ; * DO NOT CHANGE THE NAME *
  42. :parameters (?x - xpos ?y - ypos) ; * DO NOT MODIFY THE PARAMETER LIST *
  43. :precondition (and
  44. (not (lit ?x ?y))
  45. (not (black ?x ?y))
  46. ; (or (forall (?a - xpos)
  47. ; (and (right ?x ?a) (not (bulb ?a ?y)) (not (black ?a ?y)))
  48. ; )
  49. ()
  50. ; )
  51. )
  52. :effect (and
  53. (lit ?x ?y)
  54. (bulb ?x ?y)
  55. )
  56.  
  57. )
  58. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement