pddl4j
pddl4j copied to clipboard
Planner founds no plan when a plan exists
Hi,
First of all, thanks for this awesome library! I'm learning pddl and started using PDDL4j a few days ago.
It seems the planners have a bug because editor.planning.domains finds a solution to my domain & problem files when pddl4j does not.
I managed to isolate the origin of the error to the following piece of code, which is the precondition of a move action:
(or (at ?to ?watcher) (forall (?c - character) (not (at ?to ?c))) )
This disjunction leads to a "No plan found".
However, when I remove the disjunction and just let the "forall" clause, a plan is found. If I understand correctly how disjunctions work, if one of the two clauses is true, then the action should be usable, so the disjunction should not let to a "no plan found". Moreover, editor.planning.domains finds a solution to the problem almost instantly even with the disjunction there.
I tried with -p 0/1/2, but had the same result each time.
The complete action code is as following. Basically I want to force ?watcher to be set so at ?to ?watcher is true if it is possible, else ?watcher can be any character:
(:action move
:parameters (?character ?watcher - character ?from ?to - place ?characterhouse - house)
:precondition (and
(at ?from ?character)
; If someone is in the room, pick it as watcher, else take someone randomly and ignore it in effects (conditional effect).
(or
(at ?to ?watcher)
(forall (?c - character) (not (at ?to ?c)))
)
(not (= ?from ?to))
(isfromhouse ?character ?characterhouse)
;Precondition: Either ?to is locked with ?key and ?character possesses ?key, either ?to is not locked.
(or
(exists (?key - key) (and (islocked ?to ?key) (possess ?key ?character) ) )
(forall (?key - key) (not (islocked ?to ?key)) )
)
;Precondition: Either ?to is not reserved to a house, either ?character is from the right house
(or
(forall (?h - house) (not (reservedtohouse ?to ?h)) )
(reservedtohouse ?to ?characterhouse)
)
)
:effect (and
(not (at ?from ?character))
(at ?to ?character)
(when (at ?to ?watcher) (sawatplace ?character ?watcher ?to))
)
)
Do you know where it could come from? Thanks for your help!
Hi,
Thanks for you return.
Can you join us the domain and the problem that is causing the problem?
Damien
Hi Damien, Thanks for your answer. You will find attached the domain and the problem files.
is-harrypotter.txt is-harrypotter-problem.txt
You will see another action, take, which has a similar approach (disjunctive with forall) but seems to work well.
I also tried the GeneralPlannerAnytime with AStarAnytime, same problem. Thanks again,
JN
Hi,
I'm still learning pddl4j and now use directly search strategy classes etc, but have been unable to find a working configuration yet. Did you have more luck on your side?
Thanks for your help, JN
I will try my best to test your problem as soon as possible.