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

FF规划器未生成预期PDDL规划问题排查请求

PDDL规划问题排查:FF规划器未生成预期动作的原因分析

问题概述

使用FF规划器处理PDDL规划任务,已定义领域文件mover-domainP.pddl和问题文件mover-single,但FF生成的规划仅包含MOVE动作,未执行load、haul、dump动作,且生成的规划未满足demand数值目标。同时,ChatGPT给出的预期规划本身存在合法性问题。

领域文件代码

(define (domain mover-domainP)
  (:requirements :strips :typing :fluents :equality :conditional-effects :negative-preconditions)
  (:types 
    mover
    cell
  )
  (:functions
    (demand ?cell - cell) - number
  )

  (:predicates
    (link ?from_cell ?to_cell)
    (mover_at ?mover ?cell)
    (loaded_at ?mover ?cell)
    (loaded ?mover)
  )

  (:action load
    :parameters (?mover - mover ?from_cell - cell)
    :precondition
      (and
        (mover_at ?mover ?from_cell)
        (> (demand ?from_cell) 0)
        (not (loaded ?mover))
      )
    :effect
      (and
        (loaded ?mover)
        (loaded_at ?mover ?from_cell)
        (decrease (demand ?from_cell) 1)
      )
  )
     
  (:action haul
    :parameters (?mover - mover ?from_cell - cell ?to_cell - cell)
    :precondition
      (and
        (loaded ?mover)
        (mover_at ?mover ?from_cell)
        (link ?from_cell ?to_cell)
      )
    :effect
      (and
        (not (mover_at ?mover ?from_cell))
        (mover_at ?mover ?to_cell)
      )
  )

  (:action dump
    :parameters (?mover - mover ?dump_cell - cell)
    :precondition
      (and
        (loaded ?mover)
        (mover_at ?mover ?dump_cell)
      )
    :effect
      (and
        (not (loaded ?mover))
        (not (loaded_at ?mover ?dump_cell))
        (increase (demand ?dump_cell) 1)
      )
  )

  (:action move
    :parameters (?mover - mover ?from_cell - cell ?to_cell - cell)
    :precondition
      (and
        (not (loaded ?mover))
        (mover_at ?mover ?from_cell)
        (link ?from_cell ?to_cell)
      )
    :effect
      (and
        (mover_at ?mover ?to_cell)
        (not (mover_at ?mover ?from_cell))
      )
  )
)

问题文件代码

(define (problem mover-single)
  (:domain mover-domainP)
  (:objects
    mover1 - mover
    cell1 cell2 cell3 - cell
  )
  (:init
    (= (demand cell1) -1)
    (= (demand cell2) 0)
    (= (demand cell3) 1)
    (link cell2 cell1)
    (link cell2 cell3)
    (link cell3 cell2)
    (mover_at mover1 cell3)
  )
  (:goal
    (and
      (= (demand cell1) 0)
      (= (demand cell2) 0)
      (= (demand cell3) 0)
      (mover_at mover1 cell1)
    )
  )
)

预期与实际规划

预期规划(不合法)

1: (haul mover1 cell3 cell2)
2: (haul mover1 cell2 cell1)
3: (dump mover1 cell1)

注意:该预期规划第一步haul违反了haul动作的前置条件((loaded ?mover)必须为真),初始状态下mover1未加载,无法直接执行haul。

实际FF生成规划

Plan found:
0.00000: (MOVE MOVER1 CELL3 CELL2)
0.00100: (MOVE MOVER1 CELL2 CELL1)

该规划仅满足mover_at mover1 cell1的目标,未满足demand数值目标,属于无效规划。

错误原因分析

  1. 预期规划本身不合法:ChatGPT给出的规划未遵守haul动作的前置条件,必须先执行load动作才能触发haul。
  2. FF规划器的数值目标处理问题:FF的启发式算法可能优先满足布尔目标(mover_at),而未正确计算数值流(demand)所需的动作,导致生成不完整的规划。
  3. 领域文件中冗余的效果定义:dump动作中的(not (loaded_at ?mover ?dump_cell))效果无意义(loaded_at记录的是加载来源单元格,与dump目标单元格无关),可能干扰FF的状态空间搜索。
  4. FF版本或参数问题:若使用的FF版本对数值流支持不完善,或未正确启用相关参数,可能导致无法处理数值目标。

修正方案

  1. 修正预期规划为合法流程:正确的合法规划应包含load动作,示例如下:
1: (load mover1 cell3)
2: (haul mover1 cell3 cell2)
3: (haul mover1 cell2 cell1)
4: (dump mover1 cell1)
  1. 优化领域文件:移除dump动作中冗余的(not (loaded_at ?mover ?dump_cell))效果,避免干扰状态计算。
  2. 检查FF版本与参数:确保使用支持数值流的FF版本(如FF 2.3),并确认运行时未禁用数值目标处理。
  3. 验证状态转换:手动模拟状态转换,确认每个动作的前置条件和效果正确,确保数值流的变化符合目标要求。

内容的提问来源于stack exchange,提问作者Jc Gómez Sánchez

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.21 01:00:16