Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDL - initial task network returns a list of null #92

Open
o-fir opened this issue Nov 30, 2022 · 1 comment
Open

HDDL - initial task network returns a list of null #92

o-fir opened this issue Nov 30, 2022 · 1 comment
Labels

Comments

@o-fir
Copy link

o-fir commented Nov 30, 2022

Calling problem.getInitialTaskNetwork().getTasks() on Towers benchmark (IPC) returns a list with a null task.

Also, if original HTN was simply (task0 (shiftTower t1 t2 t3)) and I introduce an additional task (task1 (shiftTower t1 t2 t3)), getInitialTaskNetwork().getTasks() returns [null, null].

Domain file:
`(define (domain towers)

(:requirements :negative-preconditions
:hierarchy
:typing
:method-preconditions
)

(:types RING - OBJ TOWER - OBJ)

(:predicates
(on ?r - RING ?o - OBJ)
(goal_on ?r - RING ?o - OBJ)
(towerTop ?o - OBJ ?t - TOWER)
(smallerThan ?r - RING ?o - OBJ))
(:task shiftTower :parameters (?t1 - TOWER ?t2 - TOWER ?t3 - TOWER))
(:task selectDirection :parameters (?r - RING ?t1 - TOWER ?t2 - TOWER ?t3 - TOWER))
(:task rotateTower :parameters (?t1 - TOWER ?T2 - TOWER ?t3 - TOWER))
(:task exchange :parameters (?t1 - TOWER ?t2 - TOWER ?t3 - TOWER))
(:task move_abstract :parameters (?t1 - TOWER ?t2 - TOWER))

(:method m-shiftTower
; shift tower from ?t1 to ?t3 using ?t2
:parameters (?r - RING ?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (shiftTower ?t1 ?t2 ?t3)
:precondition (and (towerTop ?r ?t1))
:ordered-tasks (and (selectDirection ?r ?t1 ?t2 ?t3)))

(:method selectedDirection
:parameters (?r - RING ?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (selectDirection ?r ?t1 ?t2 ?t3)
:precondition (on ?r ?t1)
:ordered-tasks (and (rotateTower ?t1 ?t3 ?t2)))

(:method m-selectDirection
:parameters (?r - RING ?r1 - RING ?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (selectDirection ?r ?t1 ?t2 ?t3)
:precondition (on ?r ?r1)
:ordered-tasks (and (selectDirection ?r1 ?t1 ?t3 ?t2)))

(:method m-rotateTower
:parameters (?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (rotateTower ?t1 ?t2 ?t3)
:ordered-tasks (and (move_abstract ?t1 ?t2) (exchange ?t1 ?t2 ?t3)))

(:method exchangeClear
:parameters (?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (exchange ?t1 ?t2 ?t3)
:precondition (and (towerTop ?t1 ?t1) (towerTop ?t3 ?t3))
:ordered-subtasks (and)
)

(:method exchangeLR
:parameters (?r1 - RING ?o3 - OBJ ?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (exchange ?t1 ?t2 ?t3)
:precondition (and (towerTop ?r1 ?t1) (towerTop ?o3 ?t3) (smallerThan ?r1 ?o3))
:ordered-tasks (and (move_abstract ?t1 ?t3) (rotateTower ?t2 ?t3 ?t1)))

(:method exchangeRL
:parameters (?o1 - OBJ ?r3 - RING ?t1 - TOWER ?t2 - TOWER ?t3 - TOWER)
:task (exchange ?t1 ?t2 ?t3)
:precondition (and (towerTop ?o1 ?t1) (towerTop ?r3 ?t3) (smallerThan ?r3 ?o1))
:ordered-tasks (and (move_abstract ?t3 ?t1) (rotateTower ?t2 ?t3 ?t1)))

(:method newMethod21
:parameters (?r - RING ?o1 - OBJ ?t1 - TOWER ?o2 - OBJ ?t2 - TOWER)
:task (move_abstract ?t1 ?t2)
:ordered-subtasks (move ?r ?o1 ?t1 ?o2 ?t2))

(:action move
:parameters (?r - RING ?o1 - OBJ ?t1 - TOWER ?o2 - OBJ ?t2 - TOWER)
:precondition (and
(towerTop ?r ?t1)
(towerTop ?o2 ?t2)
(on ?r ?o1)
(smallerThan ?r ?o2))
:effect (and
(not (on ?r ?o1))
(on ?r ?o2)
(not (towerTop ?r ?t1))
(towerTop ?o1 ?t1)
(not (towerTop ?o2 ?t2))
(towerTop ?r ?t2)))
)
`

Problem file:
`(define
(problem tower_problem_1)

(:domain towers)

(:objects t1 t2 t3 - TOWER r1 - RING)
(:htn
:parameters ()
:ordered-tasks (and
(task0 (shiftTower t1 t2 t3))
)
)
(:init
(smallerThan r1 t1)
(smallerThan r1 t2)
(smallerThan r1 t3)
(on r1 t1)
(towerTop r1 t1)
(towerTop t2 t2)
(towerTop t3 t3)
(goal_on r1 t3))

(:goal (and (on r1 t3) ))
)
`

@pellierd
Copy link
Owner

pellierd commented Dec 6, 2022

This means that PDDL4J considers that there are no methods decomposing the tasks of the initial task network.
Please check that the problem has a solution and let me know. I will investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants