1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- ;; TDDC17 - Lab 4
- ;; S.'s W. problem 1
- ;; Last modification: 2020-10-04
-
- ;; Problem description
- ;; The first problem has three rooms, connect by doors as discribed below:
- ;; -------------------------------------------------------------------------
- ;; | | | |
- ;; | | | |
- ;; | light switch 1 -|- light switch2 |- light switch3 |
- ;; | | | |
- ;; | --- | door2 |
- ;; | | | door1 shakey | |
- ;; | --- (wide) | |
- ;; | box | | |
- ;; | | door3 |
- ;; | | (wide) |
- ;; | r1 | r2 | r3 |
- ;; -------------------------------------------------------------------------
- ;; Shakey must find four small objects distributed in the three rooms and bring
- ;; them back to the first room. All lights are off initially. The box allowing
- ;; Shakey to turn on the lights is in the first room.
-
-
- ;; Our problem1 definition
- (define (problem pb1)
- (:domain shakey)
-
- (:objects
- ;; Our three rooms
- r1 - room
- r2 - room
- r3 - room
-
- ;; The box
- box1 - object
-
- ;; The four small objects
- small1 - object
- small2 - object
- small3 - object
- small4 - object
-
- ;; The two Shakey's grippers
- right - gripper
- left - gripper
- )
-
- (:init
- ;; Init position
- ;; At the beginning, Shakey is in room 2.
- (position r2)
-
- ;; Init connections (as discribed above).
- (connected_wide r1 r2)
- (connected_wide r2 r1)
- (connected_wide r2 r3)
- (connected_wide r3 r2)
- (connected r1 r2)
- (connected r2 r1)
- (connected r2 r3)
- (connected r3 r2)
-
- ;; Init object positions
- (in box1 r1)
- (is_big box1)
- (in small1 r1)
- (in small2 r2)
- (in small3 r3)
- (in small4 r3)
-
- ;; Init light (light nowhere)
- ;;(not (light r1))
- ;;(not (light r2))
- ;;(not (light r3))
-
- ;; Init gripper
- (is_empty right)
- (is_empty left)
- )
-
- ;; The goal is to have all four objects in the room 1.
- (:goal
- (and (in small1 r1)
- (in small2 r1)
- (in small3 r1)
- (in small4 r1))
- )
- )
|