上面的pddl有语法错误
时间: 2024-01-29 22:03:37 浏览: 99
PDDL语言语法
非常抱歉,我在回答中犯了一个错误。以下是修正后的 PDDL 代码:
```
(define (problem crossing-river)
(:domain crossing)
(:objects farmer wolf sheep cabbage riverbank1 riverbank2)
(:init
(at farmer riverbank1)
(at wolf riverbank1)
(at sheep riverbank1)
(at cabbage riverbank1)
(at riverbank1 riverbank1)
(at riverbank2 riverbank2)
)
(:goal
(and
(at farmer riverbank2)
(at wolf riverbank2)
(at sheep riverbank2)
(at cabbage riverbank2)
)
)
(:operators
; farmer crosses river alone
(:operator cross-farmer-alone
:precondition (at farmer ?from)
:effect (and
(not (at farmer ?from))
(at farmer ?to)
(not (at ?any ?from))
(at ?any ?to)
)
)
; farmer crosses river with wolf
(:operator cross-farmer-wolf
:precondition (and
(at farmer ?from)
(at wolf ?from)
)
:effect (and
(not (at farmer ?from))
(not (at wolf ?from))
(at farmer ?to)
(at wolf ?to)
(not (at ?any ?from))
(at ?any ?to)
)
)
; farmer crosses river with sheep
(:operator cross-farmer-sheep
:precondition (and
(at farmer ?from)
(at sheep ?from)
)
:effect (and
(not (at farmer ?from))
(not (at sheep ?from))
(at farmer ?to)
(at sheep ?to)
(not (at ?any ?from))
(at ?any ?to)
)
)
; farmer crosses river with cabbage
(:operator cross-farmer-cabbage
:precondition (and
(at farmer ?from)
(at cabbage ?from)
)
:effect (and
(not (at farmer ?from))
(not (at cabbage ?from))
(at farmer ?to)
(at cabbage ?to)
(not (at ?any ?from))
(at ?any ?to)
)
)
)
)
```
感谢您指出我的错误!
阅读全文