首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PDDL Graphplan找不到计划

PDDL Graphplan找不到计划
EN

Stack Overflow用户
提问于 2014-10-15 11:44:35
回答 1查看 891关注 0票数 0

我已经用PDDL写了一个域和一个测试问题,但很明显,graphplan实现找不到一个计划。域名如下:

代码语言:javascript
复制
(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))
        )
)

现在问题来了:

代码语言:javascript
复制
(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)
      )
    )
)

对于这个特定的问题,解决方案的状态集应该是:

代码语言:javascript
复制
move(h1,h2)
enter(h2,r1)
pickup(c1,r1)

但是,正如我已经说过的,我正在使用的graphplan实现(graphplan)找不到任何计划。

EN

回答 1

Stack Overflow用户

发布于 2015-02-26 01:37:48

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

代码语言:javascript
复制
1. move h1 h2
2. enter h2 r1
3. pickup c1 r1

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

domain.pddl

代码语言:javascript
复制
(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))
        )
)

problem.pddl

代码语言:javascript
复制
(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)
      )
    )
)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26374143

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档