1

我正在尝试使用 Fast Downward Planner 解决一个简单的 pddl 问题。每当我使用><、等数字表达式时>=decrease都会出现以下错误:

Undeclared predicate: < 

问题文件:

(define (problem prob-gift)
  (:domain gift)
  (:objects
   chocolate hairband hairclip gift

  )
  (:init

     (=(amount_c chocolate)5)
     (=(amount_hb hairband)5)
     (=(amount_hr hairclip)5)

     (=(made gift)0)


  )
  (:goal
    (and
    (=(made gift)5)
    )
  )
)

域文件:

(define (domain gift) 

(:types chocolate hairband hairclip gift )

(:predicates      
  )
(:functions
   (made ?x ) 
         (amount_hb ?y ) 
         (amount_hr ?z ) 
         (amount_c ?a ) 

)



(:action make
     :parameters (?x ?y  ?z ?a)
     :precondition (and 
     (<(made ?x)5)
         (>=(amount_hb ?y)1)
         (>=(amount_hr ?z)1)
         (>=(amount_c ?a)1)


     )
     :effect (and
          (increase(made ?x)1)
                  (decrease(amount_hb ?y)1)
                  (decrease(amount_hr ?z)1)
                  (decrease(amount_c ?a)1)

           ))

)

输出:

Parsing...
Undeclared predicate: <

translate exit code: 30

Driver aborting after translate
4

2 回答 2

2

不幸的是,我在https://gitlab.com/graphs4IB/ai-planning容器化的 popf 版本 不是那么精通 ADL 并且与典型的

Constructing lookup tables:
Post filtering unreachable actions: 
A problem has been encountered, and the planner has to terminate.
-----------------------------------------------------------------
Unfortunately, at present, the planner does not fully support ADL
unless in the rules for derived predicates.  Only two aspects of
ADL can be used in action definitions:
- forall conditions, containing a simple conjunct of propositional and
  numeric facts;
- Conditional (when... ) effects, and then only with numeric conditions
  and numeric consequences on values which do not appear in the
  preconditions of actions.

To use this planner with your problem, you will have to reformulate it to
avoid ADL.  Alternatively, if you have a particularly compelling case
for them, please contact the authors to discuss it with them, who may be able to
extend the planner to meet your needs.

我从https://github.com/LCAS/popf.git获得了这个版本的 popf ,而不是在Sourceforge上发布的那个有显着代码差异的版本。

您可以通过设置此自定义规划器 URL在Jan 的会话中快速测试这一点: https ://young-spire-39208.herokuapp.com

或者,您也可以在本地运行 Docker 映像,假设您的domain.pddlproblem.pddl在当前目录中:

docker run --rm -v $PWD:/tmp registry.gitlab.com/graphs4ib/ai-planning:latest popf /tmp/domain.pddl /tmp/problem.pddl

这样做是在 Debian Stretch Docker 容器中编译 popf。如果您手边有 Debian 9 (Stretch) 或 10 (Buster) 环境,您可以手动编译 popf:

sudo apt-get -qy install git g++ cmake coinor-libcbc-dev coinor-libcgl-dev coinor-libclp-dev coinor-libcoinutils-dev bison flex \
&& git clone https://github.com/LCAS/popf.git \
&& cd popf \
&& mkdir build \
&& cd build \
&& cmake ../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE \
&& make -j \
&& make install
于 2019-11-11T02:40:14.100 回答
1

Jonaki,我相信在您的 PDDL 模型中使用类型存在问题。此外,通常,当您选择的规划器不接受您的模型(或无法解决您的问题)时,您应该削减它并从最简单的版本重新构建它,同时针对规划器不断测试它。这样,您将确切地看到是什么冒犯了它。有时打印的信息不具有代表性。

您正在使用数字流利,因此您应该包含(:requirements :fluents)在您的domain. 不支持的规划器:fluents会阻塞<,=decrease操作。

顺便说一句:您不需要在此模型中使用类型。你声明你的函数基于各种礼物对象的。因此,您可以删除类型并查看模型是否有效。该模型的删除类型的版本可在此处获得: http ://editor.planning.domains/#read_session=jugsVFKksh 您可以通过单击Solve > Plan按钮对其进行测试。规划器因分段错误而失败。它不提供任何特定的错误。但是,我尝试使用POPF规划器解决它并且它有效。正如您在此屏幕截图中看到的那样。

POPF解决方案

我没有 Fast-downward 方便,但我认为它是http://solver.planning.domains/solve服务背后的引擎,尽管您的错误消息与我看到的不对应。您使用的是最新版本的 Fast-downward 吗?

此外,如果您可以描述您要建模的内容,也许我们可以帮助您找到一种适合模式的方法来在 PDDL 中对其进行建模。

于 2019-11-08T15:51:24.907 回答