首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PDDL无法编译

PDDL无法编译
EN

Stack Overflow用户
提问于 2020-08-02 06:33:45
回答 1查看 85关注 0票数 0

试图解决让机器人清洁瓷砖的PDDL问题,但据我所知,我被困在我所做的错误的事情上,我只有向上和向下的移动动作和清理动作,但它仍然不能编译。它只是给我一个错误,告诉我无法解析域文件。

这是域名:

代码语言:javascript
复制
(define (domain floor-tile)

    (:requirements :typing)

    ;; We have two types: robots and the tiles, both are objects
    (:types robot tile - object)

    ;; define all the predicates as they are used in the probem files
    (:predicates  

    ;; described what tile a robot is at
    (robot-at ?r - robot ?x - tile)

    ;; indicates that tile ?x is above tile ?y
    (up ?x - tile ?y - tile)

    ;; indicates that tile ?x is below tile ?y
    (down ?x - tile ?y - tile)

    ;; indicates that tile ?x is right of tile ?y
    (right ?x - tile ?y - tile)

    ;; indicates that tile ?x is left of tile ?y
    (left ?x - tile ?y - tile)

    ;; indicates that a tile is clear (robot can move there)
    (clear ?x - tile)

    ;; indicates that a tile is cleaned
    (cleaned ?x - tile)
    )




(:action clean-up

  :parameters (?r - robot ?x - tile ?y - tile )
  :precondition (and (up ?y ?x) (robot-at ?r ?x) (clear ?y))
  :effect (and (not (clear ?y))  (cleaned ?y) 
                 
)


 (:action clean-down

  :parameters (?r - robot?x - tile ?y - tile)
  :precondition (and (down ?y ?x) (robot-at ?r ?x) (clear ?y))
  :effect (and (not (clear ?y))  (cleaned ?y) 
                
)


 
(:action up 
    :parameters (?r - robot?x - tile ?y - tile)
    :precondition (and (up ?y ?x) (robot-at ?r ?x) (clear ?y))
    :effect (and (robot-at ?r ?y) (not(robot-at ?r ?x))) 
)


(:action down 
     :parameters (?r - robot?x - tile ?y - tile)
     :precondition (and (down ?y ?x) (robot-at ?r ?x)(clear ?y))
     :effect (and (robot-at ?r ?y) 
            (not(robot-at ?r ?x))) 
)

(:action right 
     :parameters (?r - robot?x - tile ?y - tile)
     :precondition (and (right ?y ?x) (robot-at ?r ?x) (clear ?y))
     :effect (and (robot-at ?r ?y) 
            (not(robot-at ?r ?x)))    
)

(:action left 
     :parameters (?r - robot?x - tile ?y - tile)
     :precondition (and (left ?y ?x) (robot-at ?r ?x) (clear ?y))
     :effect (and (robot-at ?r ?y ) 
            (not(robot-at ?r ?x)))
)
)

以下是问题所在:

代码语言:javascript
复制
(define (problem prob001)
 (:domain floor-tile)
 (:objects tile_0-1 tile_0-2  
           tile_1-1 tile_1-2  
           tile_2-1 tile_2-2  - tile
           robot1 - robot
)
 (:init 
   (robot-at robot1 tile_1-1)
   (clear tile_0-1)
   (clear tile_0-2)
   (clear tile_1-2)
   (clear tile_2-1)
   (clear tile_2-2)
   (up tile_1-1 tile_0-1)
   (up tile_1-2 tile_0-2)
   (up tile_2-1 tile_1-1)
   (up tile_2-2 tile_1-2)
   (down tile_0-1 tile_1-1)
   (down tile_0-2 tile_1-2)
   (down tile_1-1 tile_2-1)
   (down tile_1-2 tile_2-2)
   (right tile_0-2 tile_0-1)
   (right tile_1-2 tile_1-1)
   (right tile_2-2 tile_2-1)
   (left tile_0-1 tile_0-2)
   (left tile_1-1 tile_1-2)
   (left tile_2-1 tile_2-2)
)
 (:goal (and
    (cleaned tile_0-1)
    (cleaned tile_0-2)
    (cleaned tile_1-1)
    (cleaned tile_2-2)
))

)
EN

回答 1

Stack Overflow用户

发布于 2020-08-02 10:35:03

clean-upclean-down:effect上都缺少括号。在添加了这些括号之后,online editor的求解器表明虽然不能达到目标,但至少可以进行解析。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63210680

复制
相关文章

相似问题

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