0

我是 PDDL 的新手,目前正在学习如何编写简单的程序以使汽车从 pt0pt0 前进到 pt1pt1。

但是,当我尝试在 PDDL 编辑器上运行它时遇到了编译错误。有经验的编码员可以告诉我我的代码有什么问题吗?非常感谢,谢谢。

问题.pdf

(define (problem parking) 
 (:domain grid_world) 
(:objects agent1  - agent
 pt0pt0 pt0pt1 pt1pt1  - gridcell
 ) 
(:init (at pt0pt0 agent1) (forward_next pt0pt0 pt0pt1) (forward_next pt0pt1 pt1pt1)) 
(:goal (at pt1pt1 agent1)) 
) 

域.pdfl

(define (domain grid_world ) 
(:requirements :strips :typing) 
(:types car
agent - car
gridcell
) 
(:predicates (at ?pt1 - gridcell ?car - car) 
(forward_next ?pt1 - gridcell ?pt2 - gridcell) 
) 
(:action FOWARD
:parameters ( ?agent - car ?pt1 - gridcell ?pt2 - gridcell) 
:precondition (and (at ?pt1 ?agent)) 
:effect (and (not (at ?pt1 ?agent)) (forward_next ?pt1 ?pt2) (at ?pt2 ?agent))
) 
) 
4

1 回答 1

1

空格在 PDDL 中无关紧要,因此: types声明中的类型继承应该是

(:types
    car - object
    agent - car
    gridcell
)

要不就...

(:types
    agent - car
    gridcell
)

您基本上定义了一个循环依赖car agent - car

修改后,你会得到这个计划:

0.00100: (foward agent1 pt0pt0 pt1pt1)

这可能不是您想要的,因此作为快速观察,将(forward_next ?pt1 ?pt2)您的动作效果移到前提条件。你会得到这个计划:

0.00100: (foward agent1 pt0pt0 pt0pt1)
0.00200: (foward agent1 pt0pt1 pt1pt1)

您可以在此会话中找到固定的(并为便于阅读而格式化)PDDL:http: //editor.planning.domains/#read_session=qrAGLXX9O1

单击“解决”进行尝试。

于 2019-09-26T23:39:50.133 回答