希望你们都做得很好。我通过解决 PDDL 域和问题文件遇到了问题。任务如下:
两名运动员 A0;A1 和教练员 T 在图中所示的训练环境中为比赛做准备。他们从 P0 开始,并且必须全部在 P3 才能完成试验。地点之间的联系通过两条路径突出显示:运动员路径(实线)和教练路径(虚线)。A0;A1 只能使用运动员路径,他们必须跳过第一个障碍物 O0,然后蹲下并从第二个 O1 下方通过。T 相反,只能走trainer path。代理不能同时移动,每一步只有一个代理可以从路径中的一个位置 Pi 移动到下一个位置。此外,为了检查运动员的表现,教练必须保持领先一步或多步,因此 A0 和 A1 决不能预测 T(即只允许他们出现在 T 已经访问过的地方)。运动员和教练员可以一起在训练路径的同一位置。例如,如果 T 在 P2 中,则 A0;A1 可以在 P0 中;P1 或 P2。运动员可以按任意顺序采取步骤(即他们总是可以就谁进行下一步达成一致)。
我已经实现了域文件和问题文件,但它在声明中没有按预期工作。我究竟做错了什么?任何帮助表示赞赏。
编码:
1. 域名
;Header and description
(define (domain competition-domain)
(:requirements :strips )
(:predicates ;todo: define predicates here
(a1 ?x)(a2 ?x)(t ?x)(o ?x)(location ?x)(at ?x ?y))
;define actions here
(:action goto
:parameters (?athlete ?from ?to)
:precondition (and (a1 ?athlete)(a2 ?athlete)(location ?from)(location ?to)(at ?athlete ?from))
:effect (and(at ?athlete ?to)
(not(at ?athlete ?from))))
(:action jump
:parameters (?athlete ?obstacle ?from ?to)
:precondition (and (a1 ?athlete) (a2 ?athlete) (o ?obstacle)
(location ?from) (location ?to)
(at ?athlete ?from))
:effect (and(at ?athlete ?to)(not(at ?athlete ?from))))
(:action crouch
:parameters (?athlete ?obstacle ?from ?to)
:precondition (and (a1 ?athlete) (a2 ?athlete) (o ?obstacle)
(location ?from) (location ?to)
(at ?athlete ?from))
:effect (and(at ?athlete ?to)(not(at ?athlete ?from))))
)
2.问题
(define (problem competition-problem) (:domain competition-domain)
(:objects A1 A2 T O0 O1 P0 P1 P2 P3
)
(:init
;todo: put the initial state's facts and numeric values here
(a1 A1) (a2 A2) (t T) (location P0) (location P1) (location P2) (location P3)
(at A1 P0) (at A2 P0) (at T P0)
)
(:goal (and
;todo: put the goal condition here
(at A1 P3) (at A2 P3) (at T P3)
))
)
因此,我的主要问题是应用动作和语句来检查障碍。
任何形式的帮助表示赞赏。