PDDL – 无效谓词和 forall 的正确使用

我正在尝试创建一个领域和问题文件作为练习。

简短的领域描述:我有几辆车,可以从A地取走并放到B地。任务很简单:将所有车从A地移到B地。我创建了以下领域文件:

(define (domain test) ; 领域名称必须与问题匹配  ; 定义规划器必须支持的功能来执行此领域  ; 目前仅支持领域要求  ( :requirements    :strips                     :negative-preconditions     :equality                   :typing                   :adl  )    (:types   car   place  )      (:predicates    (at ?o - car ?p - place )    (taken ?o - car )  )     (:action take   :parameters (?o1 - car  ?o2 - place )   :precondition (and                     (at ?o1 ?o2)                    (not (taken ?o1))                 )      :effect (and              (not (at  ?o1 ?o2 ))             (taken ?o1)           )   )         (:action put   :parameters (?o1 - car  ?o2 - place )   :precondition (and                     (not (at ?o1 ?o2))                    (taken ?o1)                 )      :effect (and              (at  ?o1 ?o2)              (not (taken ?o1) )           )   )      (:action takeAll   :parameters ()   :precondition (forall (?c - car ?p - place)                    (and                     (at ?c ?p)                    (not (taken ?c))                    )            )   :effect (forall (?c - car)                    (taken ?c)                    )            )               )

问题文件如下所示:

(define (problem test)    (:domain test)        (:objects    c1 - car    c2 - car    c3 - car        A - place    B - place    )        (:init        (at c1 A)        (at c2 A)        (at c3 A)        (not (taken c1))        (not (taken c2))        (not (taken c3))    )    (:goal (and            (at c1 B)            (at c2 B)            (at c3 B)            )    )      )

我使用的是这里提供的在线规划器和求解器,我想知道为什么它输出我有几个无效的谓词

test  takeall precondition contains ["forall", ["?c", "-", "car", "?p", "-", "place"], ["and", ["at", "?c", "?p"], ["not", ["taken", "?c"]]]], not a valid predicate  takeall effect contains ["forall", ["?c", "-", "car"], ["taken", "?c"]], not a valid predicate  :equality requirement is unnecessarytest  Initial state contains ["not", ["taken", "c1"]], not a valid predicate  Initial state contains ["not", ["taken", "c2"]], not a valid predicate  Initial state contains ["not", ["taken", "c3"]], not a valid predicate

能有人解释一下我到底做错了什么吗?使用takeAll动作,我想尝试一下forall。它的解释应该是这样的:前提条件说明所有类型为车的对象都未处于被取走的状态,并且在某个地方。效果应该是所有车都处于被取走的状态。根据我的常识,最短的解决方案应该是 takeAll, put(c1, B), (put c2, B), (put c3, B)


回答:

你在做经典规划,这意味着初始状态只需要指定什么是真的(其他一切都被假定为假)。从你的初始状态中删除那些负流体,它可能会正常工作。

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注