我刚开始计划,现在我尝试创建一个域和问题文件作为练习。短域描述:我有几辆车,它们可以放在A和B位置。任务很简单:把所有汽车从A地移到place B。我创建了以下域文件:
(define (domain test) ; Domain name must match problem's
; Define what the planner must support to execute this domain
; Only domain requirements are currently supported
( :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 unnecessary
test
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)我很感谢您的帮助!
发布于 2022-03-23 13:30:14
您正在进行经典的规划,这意味着初始状态只需要指定什么是true (其他一切都假定为假)。把那些负面的声音从你的身体里移开,它可能会产生效果。
https://stackoverflow.com/questions/71588029
复制相似问题