Fast Downward规划器使用when条件效应报错,求解决方案
Fast Downward条件效应不支持问题解决办法
问题场景
我使用Fast Downward规划器解决PDDL问题时,在domain文件的dfaact动作中通过when语句实现了条件效应。执行命令:
./fast-downward.py tests/gripper_ltlf/prob01.pddl --search "astar(lmcut())"
收到以下错误提示:
"This configuration does not support conditional effects (operator dfaact)! Terminating. Tried to use unsupported feature. Peak memory: 23248 KB Remove intermediate file output.sas search exit code: 34"
怀疑是所选搜索算法的问题,但作为Fast Downward新手,不清楚如何处理。相关domain和problem文件内容如下:
Domain文件
(define (domain gripper-strips) (:predicates (room ?r) (ball ?b) (gripper ?g) (at-robby ?r) (at ?b ?r) (free ?g) (carry ?o ?g) (world ) (dfa ) (q1)(q2)(q3)(q4) ) (:action dfaact :parameters () :precondition (and (dfa )) :effect (and (not(dfa )) (world ) (when (and (q1) (at ball1 roomb) (not(at ball4 roomb)) ) (and (q3) (not (q1))) ) (when (and (q1) (at ball1 roomb) (at ball4 roomb)) (and (q4) (not(q1))) ) (when (and (q1) (at ball4 roomb) (not(at ball1 roomb))) (and (q2) (not(q1))) ) (when (and (q3) (at ball1 roomb) (at ball4 roomb)) (and (q4) (not(q3))) ) (when (and (q3) (not(at ball1 roomb))) (and (q2) (not(q3))) ) ) ) (:action move :parameters (?from ?to) :precondition (and (room ?from) (room ?to) (at-robby ?from) (world )) :effect (and (at-robby ?to) (not (at-robby ?from)) (not(world )) (dfa ) )) (:action pick :parameters (?obj ?room ?gripper) :precondition (and (ball ?obj) (room ?room) (gripper ?gripper) (at ?obj ?room) (at-robby ?room) (free ?gripper)(world )) :effect (and (carry ?obj ?gripper) (not (at ?obj ?room)) (not (free ?gripper))(not(world )) (dfa ))) (:action drop :parameters (?obj ?room ?gripper) :precondition (and (ball ?obj) (room ?room) (gripper ?gripper) (carry ?obj ?gripper) (at-robby ?room)(world )) :effect (and (at ?obj ?room) (free ?gripper) (not (carry ?obj ?gripper))(not(world )) (dfa ))))
Problem文件
(define (problem strips-gripper-x-1) (:domain gripper-strips) (:objects rooma roomb ball4 ball3 ball2 ball1 left right) (:init (q1) (dfa) (room rooma) (room roomb) (ball ball4) (ball ball3) (ball ball2) (ball ball1) (at-robby rooma) (free left) (free right) (at ball4 rooma) (at ball3 rooma) (at ball2 rooma) (at ball1 rooma) (gripper left) (gripper right)) (:goal (and (q4) (at ball4 roomb) (at ball3 roomb) (at ball2 roomb) (at ball1 roomb))))
解决办法
1. 更换支持条件效应的搜索算法
你使用的lmcut()启发式不支持条件效应,Fast Downward中有多款支持该特性的算法,比如:
astar(blind()):盲搜索,适合快速验证基础功能astar(ff()):经典FF启发式,对条件效应兼容性好astar(hmax()):HMAX启发式,同样支持条件效应
以FF启发式为例,修改后的执行命令为:
./fast-downward.py tests/gripper_ltlf/prob01.pddl --search "astar(ff())"
2. 预处理条件效应(可选)
如果坚持要使用lmcut(),可以将带条件效应的动作拆分为多个无条件效应的独立动作。比如把dfaact中的5个when分支,分别拆成单独的动作,每个动作的前置条件包含原分支的判断条件,效应对应分支的结果。
示例拆分其中一个分支:
(:action dfaact_q1_ball1_roomb_not_ball4 :parameters () :precondition (and (dfa) (q1) (at ball1 roomb) (not(at ball4 roomb))) :effect (and (not(dfa)) (world) (q3) (not(q1))) )
将所有分支拆分完成后,lmcut()即可正常处理。
3. 确认Fast Downward基础配置
确保使用的Fast Downward版本支持条件效应(官方发行版基本都支持),无需额外编译选项,只需选择对应兼容的搜索算法即可。
内容的提问来源于stack exchange,提问作者Solya
相关产品推荐
相关产品推荐

