0

I've written a domain and a test problem in PDDL, but apparently the graphplan implementation can't find a plan. Here's the domain:

(define (domain aperture)
    (:requirements :strips :typing :negative-preconditions)
    (:types
        cube
        hallway room - location
        )
    (:predicates
        (at ?l - location)
        (has ?c - cube)
        (connected ?l1 - location ?l2 - location)
        (in ?c - cube ?l - location)
        )
    (:action enter
        :parameters (?h - hallway ?r - room)
        :precondition (and (connected ?h ?r) (connected ?r ?h) (at ?h)
                        (not (at ?r)))
        :effect (and (at ?r) (not (at ?h)))
        )
    (:action exit
        :parameters (?r - room ?h - hallway)
        :precondition (and (connected ?r ?h) (connected ?h ?r) (at ?r)
                        (not (at ?h)))
        :effect (and (at ?h) (not (at ?r)))
        )
    (:action move
        :parameters (?h1 ?h2 - hallway)
        :precondition (and (connected ?h1 ?h2) (connected ?h2 ?h1) 
                           (at ?h1) (not (at ?h2)))
        :effect (and (at ?h2) (not (at ?h1)))
        )
    (:action pickup
        :parameters (?c - cube ?l - location)
        :precondition (and (at ?l) (not (has ?c)) (in ?c ?l))
        :effect (and (has ?c) (not (in ?c ?l)))
        )
    (:action drop
        :parameters (?c - cube ?l - location)
        :precondition (and (at ?l) (has ?c) (not (in ?c ?l)))
        :effect (and (not (has ?c)) (in ?c ?l))
        )
)

and here's the problem:

(define (problem pb1)
  (:domain aperture)
  (:requirements :strips :typing) 
  (:objects h1 - hallway
        h2 - hallway
        h3 - hallway
        r1 - room
        c1 - cube)
  (:init (at h1)
     (connected h1 h2)
     (connected h2 h1)
     (connected h2 h3)
     (connected h3 h2)
     (connected h2 r1)
     (connected r1 h2)
     (in c1 r1)
     )
  (:goal (and 
      (has c1)
      )
    )
)

For this particular problem the set of states for the solution should be:

move(h1,h2)
enter(h2,r1)
pickup(c1,r1)

but, as I've said, the graphplan implementation that I'm using (graphplan) can't find any plan.

4

1 回答 1

0

我能够使用strips找到解决方案。但是,我不得不稍微调整您的域。具体来说,我更改了域操作“pickup”和“drop”以将参数类型“location”替换为“room”。通过此更改,我能够找到以下解决方案:

1. move h1 h2
2. enter h2 r1
3. pickup c1 r1

也许这可能是graphplan也无法找到解决方案的原因?这是修改后的域和问题 pddl 文件。

域.pdfl

(define (domain aperture)
    (:requirements :strips :typing :negative-preconditions)
    (:types
        cube
        hallway room - location
        )
    (:action enter
        :parameters (?h - hallway ?r - room)
        :precondition (and (connected ?h ?r) (connected ?r ?h) (at ?h)
                        (not (at ?r)))
        :effect (and (at ?r) (not (at ?h)))
        )
    (:action exit
        :parameters (?r - room ?h - hallway)
        :precondition (and (connected ?r ?h) (connected ?h ?r) (at ?r)
                        (not (at ?h)))
        :effect (and (at ?h) (not (at ?r)))
        )
    (:action move
        :parameters (?h1  - hallway ?h2 - hallway)
        :precondition (and (connected ?h1 ?h2) (connected ?h2 ?h1) 
                           (at ?h1) (not (at ?h2)))
        :effect (and (at ?h2) (not (at ?h1)))
        )
    (:action pickup
        :parameters (?c - cube ?l - room)
        :precondition (and (at ?l) (not (has ?c)) (in ?c ?l))
        :effect (and (has ?c) (not (in ?c ?l)))
        )
    (:action drop
        :parameters (?c - cube ?l - room)
        :precondition (and (at ?l) (has ?c) (not (in ?c ?l)))
        :effect (and (not (has ?c)) (in ?c ?l))
        )
)

问题.pdf

(define (problem pb1)
  (:domain aperture)
  (:objects h1 - hallway
        h2 - hallway
        h3 - hallway
        r1 - room
        c1 - cube)
  (:init (at h1)
     (connected h1 h2)
     (connected h2 h1)
     (connected h2 h3)
     (connected h3 h2)
     (connected h2 r1)
     (connected r1 h2)
     (in c1 r1)
     )
  (:goal (and 
      (has c1)
      )
    )
)
于 2015-02-25T17:37:47.953 回答