首页 > 解决方案 > 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 运行这些文件。我预计该计划将是“喝,喝,喝,喝,喝完”,但它发现的计划只是“喝完”。有人可以解释我是否做错了什么,或者它是否工作正常而我的期望是错误的(我确定我是在程序方面考虑它)?谢谢。

标签: planningpddl

解决方案


我知道这是一个旧线程,但我已经为类似的问题苦苦挣扎了好几天!

我也需要使用: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

我希望这将帮助其他遇到此类问题的人。


推荐阅读