planning - PDDL - 使用solver.planning.domains 使用数字流利
问题描述
我是一个规划的菜鸟,我正在寻求数字流利的帮助。这是一个示例域和问题,它没有按照我认为的方式工作。
领域:
(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 运行这些文件。我预计该计划将是“喝,喝,喝,喝,喝完”,但它发现的计划只是“喝完”。有人可以解释我是否做错了什么,或者它是否工作正常而我的期望是错误的(我确定我是在程序方面考虑它)?谢谢。
解决方案
我知道这是一个旧线程,但我已经为类似的问题苦苦挣扎了好几天!
我也需要使用:fluents
并找到一个能够理解它的计划者并不是那么容易。
我终于找到了这个METRIC-FF(补丁版本,我使用了这个),它工作得很好。
我试过你的代码,结果如下:
ff: parsing domain file
domain 'TEQUILA' defined
... done.
ff: parsing problem file
problem 'DRINK' defined
... done.
no metric specified. plan length assumed.
checking for cyclic := effects --- OK.
ff: search configuration is EHC, if that fails then best-first on 1*g(s) + 5*h(s) where
metric is plan length
Cueing down from goal distance: 5 into depth [1]
4 [1]
3 [1]
2 [1]
1 [1]
0
ff: found legal plan as follows
step 0: DRINK CASAMIGOS-ANEJO
1: DRINK CASAMIGOS-ANEJO
2: DRINK CASAMIGOS-ANEJO
3: DRINK CASAMIGOS-ANEJO
4: DONE-DRINKING CASAMIGOS-ANEJO
time spent: 0.00 seconds instantiating 2 easy, 0 hard action templates
0.00 seconds reachability analysis, yielding 1 facts and 2 actions
0.00 seconds creating final representation with 1 relevant facts, 2 relevant fluents
0.00 seconds computing LNF
0.00 seconds building connectivity graph
0.00 seconds searching, evaluating 6 states, to a max depth of 1
0.00 seconds total time
我希望这将帮助其他遇到此类问题的人。
推荐阅读
- python - 验证时如何更改条目中的值
- php - 将包含外键的列添加到 Laravel 生产中的现有表中
- reactjs - TextInput 未在 React Native 中显示
- android - 无法将文件添加到 Android 10 的特定文件夹位置
- css - 如何使用 kotlin 样式将 CSS 应用于 KotlinJS/React 中的表格(边框)?
- python - 从文件中删除记录时如何保持文本的特定格式相同
- django - 上传文件未在服务器存储中上传
- c# - 迁移成功但未显示在数据库中
- typescript - 使用带有箭头函数的泛型类型的 Typescript Playground 错误
- jaeger - Jaeger 与 springboot 的集成