I am trying to solve a planning problem in PDDL using the FF planner. I have defined a domain and a problem, but the results I am getting do not match what I expected based on ChatGPT’s explanation. Below is the code and the expected results.
Domain (mover-domainP.pddl):
(define (domain mover-domainP)
(:requirements :strips :typing :fluents :equality :conditional-effects :negative-preconditions)
(:types
mover
cell
)
(:functions
(demand ?cell - cell) - number
)
(:predicates
(link ?from_cell ?to_cell)
(mover_at ?mover ?cell)
(loaded_at ?mover ?cell)
(loaded ?mover)
)
(:action load
:parameters (?mover - mover ?from_cell - cell)
:precondition
(and
(mover_at ?mover ?from_cell)
(> (demand ?from_cell) 0)
(not (loaded ?mover))
)
:effect
(and
(loaded ?mover)
(loaded_at ?mover ?from_cell)
(decrease (demand ?from_cell) 1)
)
)
(:action haul
:parameters (?mover - mover ?from_cell - cell ?to_cell - cell)
:precondition
(and
(loaded ?mover)
(mover_at ?mover ?from_cell)
(link ?from_cell ?to_cell)
)
:effect
(and
(not (mover_at ?mover ?from_cell))
(mover_at ?mover ?to_cell)
)
)
(:action dump
:parameters (?mover - mover ?dump_cell - cell)
:precondition
(and
(loaded ?mover)
(mover_at ?mover ?dump_cell)
)
:effect
(and
(not (loaded ?mover))
(not (loaded_at ?mover ?dump_cell))
(increase (demand ?dump_cell) 1)
)
)
(:action move
:parameters (?mover - mover ?from_cell - cell ?to_cell - cell)
:precondition
(and
(not (loaded ?mover))
(mover_at ?mover ?from_cell)
(link ?from_cell ?to_cell)
)
:effect
(and
(mover_at ?mover ?to_cell)
(not (mover_at ?mover ?from_cell))
)
)
)
and the problem file
(define (problem mover-single)
(:domain mover-domainP)
(:objects
mover1 - mover
cell1 cell2 cell3 - cell
)
(:init
(= (demand cell1) -1)
(= (demand cell2) 0)
(= (demand cell3) 1)
(link cell2 cell1)
(link cell2 cell3)
(link cell3 cell2)
(mover_at mover1 cell3)
)
(:goal
(and
(= (demand cell1) 0)
(= (demand cell2) 0)
(= (demand cell3) 0)
(mover_at mover1 cell1)
)
)
)
Expected Result:
According to ChatGPT, the expected plan is:
1: (haul mover1 cell3 cell2)
2: (haul mover1 cell2 cell1)
3: (dump mover1 cell1)
Result Obtained with FF:
When I run the FF planner, I get the following plan:
Plan found:
0.00000: (MOVE MOVER1 CELL3 CELL2)
0.00100: (MOVE MOVER1 CELL2 CELL1)
Identified Problem:
It seems that the FF planner is not using the load, haul, and dump actions as expected. Instead, it is only generating simple movements between the cells.
Question:
Could someone help me identify why the FF planner is not generating the expected plan? Is there an issue with the domain or problem definition that is causing this behavior? Any guidance would be greatly appreciated.
Thanks in advance.
Jc Gómez Sánchez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I did not look too deep into your PDDL, but it seems to include numeric fluents and FF is a classical planner, you might need the metric-FF or another numeric planner (assuming that your PDDL is correct).