I'm doing a small thesis about Self-Recovery using PDDL, and now creating a crane model that could turn to different locations.
The action crane_turn
's length depends on the distance between two locations.
Here is the domain file
(define (domain Recovery1)
(:requirements :strips :fluents :typing :equality :disjunctive-preconditions :durative-actions :duration-inequalities)
(:types
stack stamp conveyor - loc
)
(:predicates
(crane_at ?loc - object)
(valve_not_working)
)
(:functions
(distance_to_move)
(distance ?from - loc ?to - loc)
)
(:durative-action crane_turn
:parameters (?from - loc ?to - loc)
:duration (>= ?duration 0)
:condition (and
(at start (and
(crane_at ?from)
(valve_not_working)
))
(over all (and
(>= (distance_to_move) 0) ;to stop the action
))
)
:effect (and
(at start (and
(not (crane_at ?from))
(assign (distance_to_move) (distance ?from ?to))
))
(decrease (distance_to_move) (* #t 1.0))
(at end (crane_at ?to))
)
)
the problem file
(define (problem Recovery1_prob) (:domain Recovery1 )
(:objects
stack - stack
stamp - stamp
conveyor - conveyor
)
(:init
(= (distance stack stamp) 6)
(= (distance stamp stack) 6)
(= (distance stack conveyor) 3)
(= (distance conveyor stack) 3)
(= (distance stamp conveyor) 3)
(= (distance conveyor stamp) 3)
(valve_not_working)
(crane_at stack)
)
(:goal (crane_at stamp))
)
when i run them by planner OPTIC the output shows
Constructing lookup tables: [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%] [110%] [120%]
Post filtering unreachable actions: [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%] [110%] [120%]
No semaphore facts found, returning
Effect ((distance_to_move) = 0.000) is orphaned
(distance_to_move) has finite bounds: [3.000,6.000]
Have identified that bigger values of (distance_to_move) are preferable
[01;34mNo analytic limits found, not considering limit effects of goal-only operators[00m
Assignment numeric effect ((distance_to_move) = 0.000) makes effects on 0 be order-dependent
Assignment numeric effect ((distance_to_move) = 3.000) makes effects on 0 be order-dependent
Assignment numeric effect ((distance_to_move) = 6.000) makes effects on 0 be order-dependent
None of the ground temporal actions in this problem have been recognised as compression-safe
Initial heuristic = 2.000, admissible cost estimate 0.000
Error: Aborted
how could I correct the domain file and solve that kind of problem?
It could be it is getting confused with the (crane_at ?loc - object)
predicate, due to the general object
type.
Try to fix your domain definition as follows:
(:types
loc - object ;typically planners do this implicitly, but you never know
stack stamp conveyor - loc
)
(:predicates
(crane_at ?l - loc)
(valve_not_working)
)
And you seem to have a missing closing brackets at the end.
Note that in your case, nothing is forcing the action to take the duration in relation to the distance needed to move.
If you really want to leave the ?duration
undefined, you need to tell it that at the end of the action, distance-to-move
needs to be 0.
So you would need to add this to the condition:
(at end (= (distance_to_move) 0))
However, this might risk floating point issues, and also the assumption is that nothing else is interfering with distance_to_move
. A simpler version of the same action would be:
(:durative-action crane_turn
:parameters (?from - loc ?to - loc)
:duration (= ?duration (distance ?from ?to))
:condition (and
(at start (and
(crane_at ?from)
(valve_not_working)))
)
:effect (and
(at start (not (crane_at ?from)))
(at end (crane_at ?to))
)
)
It achieves exactly the same thing, and the ?duration
is relative to the distance. You can have a more sophisticated arithmetic expression of course.
From my experience OPTIC is pretty unstable. If you still find problems you might want to try the older POPF.