[Project IFT702] / Problem with recharge action



During the project, we considered many planners : Metric-FF, HSP* and LGP. Due to some limitations of theses planners, we tried to generalize our PDDL domain file to have to maximum compatibility.

Even some PDDL code seems to be equivalent, we faced a very stange error. Here, we will talk about some problem that we get with recharge action. Actually, this problem is resolved for Metric-FF by using the assign keyword of PDDL.

Rechage Action:

(:action RECHARGE
  :parameters(?where - location)
  :precondition(and
      (robot-at ?where)
      (registered)
      (rechargeable-place ?where)
    )
  :effect(and
      (assign (battery-level) (max-battery-capacity))
      (increase (currenttime) 3600)
    )
)
Extract from ScientificConf.pddl


Tests that need to recharge:

test_battery1.fct

(define (problem generated-problem)
  (:domain ScientificConference)
  (:objects
      [...]
  )
  (:init
      [...]
    (= (battery-level) 133.0)  ; current battery level

      [...]
  )
  (:goal (and
    (presentation-done pressession0 StandRoom_1)
    (>= (battery-level) 400)
  ))
)

Simple exemple that need a recharge action to satified the goal.

../Metric-FF/ff -o ScientificConf.pddl -f test_battery1.fct -E

 0: GOTO STARTPLACE REGISTRATION
 1: REGISTER REGISTRATION
 2: GOTO REGISTRATION FRONTROOM_1
 3: GOTO FRONTROOM_1 FRONTROOM_2
 4: GOTO FRONTROOM_2 FRONTROOM_3
 5: GOTO FRONTROOM_3 FRONTCOFFEEROOM
 6: GOTO FRONTCOFFEEROOM COFFEEROOM
 7: GOTO COFFEEROOM COFFEEROOM_CHARGER
 8: RECHARGE COFFEEROOM_CHARGER
 9: GOTO COFFEEROOM_CHARGER COFFEEROOM_COFFEE
10: GOTO COFFEEROOM_COFFEE P23
11: GOTO P23 P21
12: GOTO P21 FRONTROOM_2
13: GOTO FRONTROOM_2 FRONTROOM_1
14: GOTO FRONTROOM_1 STANDROOM_1
15: WAIT-PRES-SESSION PRESSESSION0
16: MAKE-PRESENTATION STANDROOM_1 PRESSESSION0

Time to plan : 20.32s

test_battery1_nav.fct

Same test as before, but with a navigation table (navigation anypoint to anypoint is possible with GOTO).

../Metric-FF/ff -o ScientificConf.pddl -f test_battery1_nav.fct -E

 0: GOTO STARTPLACE REGISTRATION
 1: REGISTER REGISTRATION
 2: GOTO REGISTRATION COFFEEROOM_CHARGER
 3: RECHARGE COFFEEROOM_CHARGER
 4: GOTO COFFEEROOM_CHARGER STANDROOM_1
 5: WAIT-PRES-SESSION PRESSESSION0
 6: MAKE-PRESENTATION STANDROOM_1 PRESSESSION0


Time to plan : 5.40s


Strange error that we face

Look at the following code :

First version
(ScientificConf_exRecharge.pddl)
Final Version
(ScientificConf.pddl)
(:action RECHARGE
  :parameters(?where - location)
  :precondition(and
    (robot-at ?where)
     (registered)
     (rechargeable-place ?where)
     )
  :effect(and
    (increase (battery-level) (- (max-battery-capacity) (battery-level)))
    (increase (currenttime) 3600)
  )
)


(:action RECHARGE
  :parameters(?where - location)
  :precondition(and
    (robot-at ?where)
     (registered)
     (rechargeable-place ?where)
     )
  :effect(and
    (assign (battery-level) (max-battery-capacity))
    (increase (currenttime) 3600)
  )
)
Here, we increase battery-level by the difference needed to reach maximum capacity
Here we assign the battery-level to his maximum capacity

Both versions seems to be equivalent. In fact, battery-level will get the same value in both cases.

At the beginnig, we were forced to use increase PDDL's keyword because HSP* doesn't support assign keyword.

After some experimentation with Metric-FF, we were very confused because we were never able to get a plan with recharge action for very and very basics problems. Bellow is the output of the planner when we run it with first version of recharge code.

[eric@localhost projet]$ ../Metric-FF/ff -o ScientificConf_exRecharge.pddl -f test_battery1_nav.fct -E

checking for cyclic := effects --- OK.

ff: search configuration is  best-first on 1*g(s) + 5*h(s) where
    metric is  plan length

advancing to distance:   60

all increasers applied yet goal not fulfilled.



This error is very strange. We think that it is related about the heuristic under Metric-FF and numerics. But, we did not have enough time to confirm the real source of the problem.