Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (def world3
- '#{(connects A1 A2)
- (connects A2 A1)
- (connects A2 A3)
- (connects A3 A2)
- (connects B1 B2)
- (connects B2 B3)
- (connects B3 B2)
- (connects B2 B1)
- (above B1 A3)
- (above C1 B3)
- (on ball C1)
- (on ball2 B2)
- (platform B1)
- (platform B2)
- (platform B3)
- (platform C1)
- (climbable B1)
- (climbable C1)
- (manipulable ball)
- (manipulable ball2)
- (agent R)
- })
- (def state3
- '#{(at R A1)
- (holds R nil) ;Would just return nil without this
- })
- (def ops3
- '{climb-on {:pre ((agent ?agent) ; FIRST VERSION OF CLIMB ON
- (at ?agent ?place)
- (above ?platform ?place)
- (climbable ?platform)
- (holds ?agent nil)) ;This came later when we thought about the platform problem
- :del ((at ?agent ?place))
- :add ((at ?agent ?platform))
- :txt (climb on ?platform)
- :cmd [on ?agent ?platform]
- }
- pick-off {:pre ((agent ?agent)
- (manipulable ?obj)
- (platform ?platform)
- (at ?agent ?platform)
- (on ?obj ?platform)
- (holds ?agent nil))
- :add ((holds ?agent ?obj))
- :del ((on ?obj ?platform)
- (holds ?agent nil))
- :txt ((Pick off ?obj from ?platform))
- :cmd [Pick-off ?obj from ?platform]
- }
- move {:pre ((agent ?agent)
- (at ?agent ?p1)
- (connects ?p1 ?p2))
- :add ((at ?agent ?p2))
- :del ((at ?agent ?p1))
- :txt ((move from ?p1 to ?p2))
- :cmd [move ?p1 to ?p2]
- }
- climb-off {:pre ((agent ?agent)
- (at ?agent ?platform)
- (above ?platform ?place)
- (holds ?agent nil))
- :del ((at ?agent ?platform))
- :add ((at ?agent ?place))
- :txt (climb-off from ?platform)
- :cmd [climb-off from ?platform]
- }
- drop-on {:pre ((agent ?agent)
- (platform ?platform)
- (at ?agent ?platform)
- (:not (holds ?agent nil))
- (holds ?agent ?obj))
- :add ((holds ?agent nil)
- (on ?obj ?platform))
- :del ((holds ?agent ?obj))
- :txt ((drop-on ?obj on ?platform))
- :cmd [drop-on ?obj ?platform]
- }
- drop-from-platform {:pre ((agent ?agent)
- (platform ?platform)
- (at ?agent ?platform)
- (above ?platform ?place)
- (:not (holds ?agent nil))
- (holds ?agent ?obj))
- :add ((holds ?agent nil)
- (on ?obj ?place))
- :del ((holds ?agent ?obj))
- :txt ((Drop-from ?obj to ?place))
- :cmd [drop-from ?obj to ?place]
- }
- drop {:pre ((agent ?agent)
- (at ?agent ?place)
- (:not (holds ?agent nil)) ;Agent would drop object "?obj" when holding nil so this line works around that
- (holds ?agent ?obj))
- :add ((holds ?agent nil)
- (on ?obj ?place))
- :del ((holds ?agent ?obj))
- :txt ((Drop ?obj at ?place))
- :cmd [drop ?obj at ?place]
- }
- pickup {:pre ((agent ?agent)
- (manipulable ?obj)
- (at ?agent ?place)
- (on ?obj ?place)
- (holds ?agent nil))
- :add ((holds ?agent ?obj))
- :del ((on ?obj ?place)
- (holds ?agent nil))
- :txt ((pickup ?obj at ?place))
- :cmd [pickup ?obj from ?place]
- }
- })
- ; (ops-search state3 '((at R A1)(holds R ball)) ops3 :world world3)
- ; (ops-search state3 '((at R A2) (on ball B2) (holds R nil)) ops3 :world world3)
- ; (ops-search state3 '((at R A2) (on ball B2) (on ball2 A3) (holds R nil)) ops3 :world world3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement