0

I'm a noob at planning and I'm looking for help with numeric fluents. Here's a sample domain and problem that isn't working the way I think it should.

Domain:

(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)
 )
)

and the problem:

(define (problem drink)
  (:domain tequila)
  (:objects
    casamigos-anejo - bottle
  )
  (:init
    (= (amount casamigos-anejo) 4)
  )
  ; drink all the tequila
  (:goal
    (bottle-finished casamigos-anejo) 
  )
)

I'm running the files using editor.planning.domains. I expected that the plan would be "drink, drink, drink, drink, done-drinking" but the plan it finds is just "done-drinking". Can someone explain if I'm doing something wrong, or if it's working correctly and my expectation is wrong (I'm sure I'm thinking of it in procedural terms)? Thanks.

Steve-MA
  • 1
  • 1
  • 1
  • Puzzling! I can only assume that it's an error with the solver, as it seems to have the amount as zero in the "plan". I can't see anything wrong with your PDDL. – Oliver Mason Apr 24 '20 at 09:00

3 Answers3

2

Unfortunately, at this time, the online solver only handles an extension of classical planning (ADL, etc) which does not include numeric fluents. This will hopefully change in the near future, but for the moment the online solver is unable to handle that type of problem.

haz
  • 625
  • 4
  • 12
  • So does that mean it ignores the ':requirements fluents' part? – Oliver Mason Apr 24 '20 at 13:30
  • Thanks for the info; at least I can stop trying to fix my domain definition. Are there online solvers that would support PDDL 2.1 (I think I need that for numeric fluents), or one that might be suitable for a novice to install and use? – Steve-MA Apr 25 '20 at 08:50
  • 1
    It tries its best to solve things, and so ignoring the `:requirements` section (in case the author messes it up) is part of that. There will be a project ready in a couple of weeks that will get you easy access (if you have Ubuntu or Docker or VMWare running) to planners that support 2.1: https://github.com/AI-Planning/planning-utils – haz Apr 25 '20 at 17:42
  • I'll keep an eye on the project. In the meantime, I'll build a Ubuntu system and see if I can install a planner. Thanks again for the help. – Steve-MA Apr 25 '20 at 21:40
1

I know this is an old thread, but I've been struggling for days with a similar problem!

I too need to use :fluents and finding a planner that is able to understand it was not so easy.

I finally found this METRIC-FF (patched version, I used this one) which works perfectly.

I tried your code and the result is the following:

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

I hope this will help others who have struggled with problems like this.

Brux
  • 11
  • 2
0

@haz, I could not make your project work, but I checked all the planners in your bundle and it seems none of the actually do Numeric planning. Is Metric-FF really the only one out there that does numeric planning? LPG is buggy rubbish when it comes to numeric planning.

tomitrescak
  • 1,072
  • 12
  • 22