STRIPS 计划器无法编译



我一直在做一个关于狐狸鹅豆养殖户的项目。我正在尝试在基于浏览器的编译器上实现它https://stripsfiddle.herokuapp.com/。除moveFoxAcross和moveFoxBack外,所有函数都能工作。我看不出任何瑕疵。有人能指出我的错误或建议任何有效的语法来源吗。这是我的域名:

(define (domain domain-FGB)
(:requirements :strips :typing)
(:types fox goose beans farmer onLeftBank)
(:action moveGooseAcross
:parameters (?g - goose ?l - onLeftBank ?f - farmer)
:precondition (and (not (at ?g ?l)) (not (at ?f ?l)))
:effect (and (at ?g ?l) (at ?f ?l))
)
(:action moveFoxAcross
:parameters (?fo - fox ?l - onLeftBank ?f - farmer ?b - beans ?g - goose)
:precondition (and (not (at ?fo ?l)) (not (at ?f ?l))(or (and (not (at ?b ?l)) (at ?g ?l)) (and (at ?b ?l) (not (?g ?l)))))
:effect (and (at ?fo ?l) (at ?f ?l))
)
(:action moveBeansAcross 
:parameters (?b - beans ?fo - fox ?l - onLeftBank ?f - farmer ?g - goose)
:precondition (and (not (at ?b ?l)) (not (at ?f ?l))(or (and (not (at ?fo ?l)) (at ?g ?l)) (and (at ?fo ?l) (not (at ?g ?l)))))
:effect (and (at ?b ?l) (at ?f ?l))
)
(:action farmerAcrossRiver 
:parameters (?f - farmer ?l - onLeftBank)
:precondition (not (at ?f ?l))
:effect (at ?f ?l)
)
(:action moveGooseBack 
:parameters (?g - goose ?l - onLeftBank ?f - farmer)
:precondition (and (at ?g ?l)   (at ?f ?l))
:effect (and (not (at ?g ?l)) (not (at ?f ?l))))
(:action moveFoxBack 
:parameters (?fo - fox ?l - onLeftBank ?f - farmer ?b - beans ?g - goose)
:precondition (and (at ?fo ?l) (at ?f ?l) (or (and (not (at ?b ?l)) (at ?g ?l)) (and (at ?b ?l) (not (?g ?l)))))
:effect (and (not (at ?fo ?l)) (not (at ?f ?l))))
(:action moveBeansBack 
:parameters (?b - beans ?fo - fox ?l - onLeftBank ?f - farmer ?g - goose)
:precondition (and (at ?b ?l) (at ?f ?l)(or (and (not (at ?fo ?l)) (at ?g ?l)) (and (at ?fo ?l) (not (at ?g ?l)))))
:effect (and (not (at ?b ?l)) (not (at ?f ?l))))
(:action farmerGoesBack 
:parameters (?f - farmer ?l - onLeftBank)
:precondition (at ?f ?l)
:effect (not (at ?f ?l))
))

这是我的问题代码:

(define (problem FGB)
(:domain domain-FGB)
(:objects 
FOX - fox 
GOOSE - goose 
BEANS - beans 
FARMER - farmer
ONLEFTBANK - onLeftBank)
(:init 
(and (not(at FOX ONLEFTBANK)) (not(at GOOSE ONLEFTBANK)) (not(at FARMER ONLEFTBANK)) (not(at BEANS ONLEFTBANK))))
(:goal (and (at FOX ONLEFTBANK) (at GOOSE ONLEFTBANK) (at FARMER ONLEFTBANK) (at BEANS ONLEFTBANK))))

这是我的问题:

  • 只有moveFoxAcross和moveFoxBack函数不起作用,并且出现编译错误。你能帮我看看为什么吗
  • 即使我在没有它们的情况下编译,它也给了我0个解决方案
  • 有什么例子可以帮我解决这个问题吗

您只需从域部分的列表中选择"创建您自己的",然后复制/粘贴我的代码即可亲自尝试。

提前感谢

问题是第二个或子句的第二个和子句中缺少"at"。下面的首都AT。

:precondition (and 
(not (at ?fo ?l)) 
(not (at ?f ?l)) 
(or (and 
(not (at ?b ?l)) 
(at ?g ?l)
) 
(and 
(at ?b ?l) 
(not (AT ?g ?l))
)
)
)

但我找不到这个修正的解决方案。我继续工作,如果找到任何解决方案,我会通知你。

相关内容

  • 没有找到相关文章

最新更新