You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PDDL durative-action声明语法错误排查求助

排查PDDL durative-action语法错误的解决方案

嘿,我一眼就瞅出你这个持续动作的语法问题了——PDDL里的durative-action对条件和效果的写法有严格要求,必须明确标注它们生效的时间区间,你现在的代码直接把条件和效果写上去,没指定时间阶段,这就是触发报错的核心原因。

具体问题点

  • 条件部分(:condition):持续动作的条件必须用:at start(动作开始时满足)、:over all(整个动作过程中保持满足)或:at end(动作结束时满足)来包裹,你的代码里直接写了(and ...),缺少时间标注。对于go_room这个动作,这些前置条件应该是动作启动时必须成立的,所以要套上:at start。
  • 效果部分(:effect):同理,动作的效果也需要指定时间节点。机器人从房间x移动到y,这个状态变化应该是动作完成时才生效的,所以要把效果套在:at end里。

修正后的完整代码

(define (domain rooms) 
(:requirements :strips :typing :durative-actions ) 
(:types room zone robot door elevator ) 
(:predicates 
(robot_at ?r - robot ?x - room) 
(robot_at_zone ?r - robot ?x - room ?z - zone) 
(zone_at_room ?z - zone ?x - room) 
(is_next ?x - room ?y - room) 
(is_in_other_floor ?x - room ?y - room) 
(door_closed ?d - door ?x - room ?y - room) 
(door_opened ?d - door ?x - room ?y - room) 
) 
(:durative-action go_room 
:parameters (?r - robot ?x - room ?y - room ?d - door) 
:duration (= ?duration 5) 
:condition (and (:at start (robot_at ?r ?x)) 
                (:at start (is_next ?x ?y)) 
                (:at start (door_opened ?d ?x ?y)) ) 
:effect (and (:at end (robot_at ?r ?y)) 
             (:at end (not (robot_at ?r ?x)) ) ) 
)

补充说明

如果你有需要整个动作过程中都保持成立的条件(比如移动过程中门不能关上),就可以用:over all来标注;如果是动作结束时需要满足的条件(比如到达后某个状态必须存在),就用:at end。这样规划器才能准确计算动作的时间线和状态变化逻辑。

内容的提问来源于stack exchange,提问作者Alberto-D

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 09:32:34