我是一个规划的菜鸟,我正在寻求数字流利的帮助。这是一个示例域和问题,它没有按照我认为的方式工作。
领域:
(define (domain tequila)
(:requirements :typing :fluents)
(:types
bottle
)
(:functions
(amount ?b - bottle)
)
(:predicates
(bottle-finished ?b - bottle)
)
(:action drink
:parameters (?b - bottle)
:precondition (>= (amount ?b) 1)
:effect (decrease (amount ?b) 1)
)
(:action done-drinking
:parameters (?b - bottle)
:precondition (= (amount ?b) 0)
:effect (bottle-finished ?b)
)
)
和问题:
(define (problem drink)
(:domain tequila)
(:objects
casamigos-anejo - bottle
)
(:init
(= (amount casamigos-anejo) 4)
)
; drink all the tequila
(:goal
(bottle-finished casamigos-anejo)
)
)
我正在使用 editor.planning.domains 运行这些文件。我预计该计划将是“喝,喝,喝,喝,喝完”,但它发现的计划只是“喝完”。有人可以解释我是否做错了什么,或者它是否工作正常而我的期望是错误的(我确定我是在程序方面考虑它)?谢谢。