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

Return all of the ground actions possible instead of failing for just one #2

Open
guanghuhappysf128 opened this issue May 19, 2020 · 8 comments

Comments

@guanghuhappysf128
Copy link

When I use solver API, the following case happens. I didn't have any action named reach-goal. Here is the return json:

{
    "status": "ok",
    "result": {
        "parse_status": "ok",
        "length": 7,
        "plan": [
            "(move a1 b1)",
            "(move b1 b2)",
            "(move b2 b3)",
            "(move b3 a3)",
            "(move a3 a4)",
            "(move a4 a5)",
            "(reach-goal)"
        ],
        "error": "'reach-goal'",
        "output": "\n\ntask contains conditional effects. turning off state domination.\n\n --- OK.\n Match tree built with 19 nodes.\n\nPDDL problem description loaded: \n\tDomain: PACMAN_MID\n\tProblem: PACMAN-LEVEL-1\n\t#Actions: 19\n\t#Fluents: 20\nLandmarks found: 1\nStarting search with IW (time budget is 60 secs)...\nrel_plan size: 6\n#RP_fluents 10\nCaption\n{#goals, #UNnachieved,  #Achieved} -> IW(max_w)\n\n{1/1/0}:IW(1) -> [2][3][4][5][6][7][8]rel_plan size: 0\n#RP_fluents 0Plan found with cost: 7\nTotal time: -1.07288e-09\nNodes generated during search: 42\nNodes expanded during search: 34\nIW search completed\n",
        "type": "simple",
        "planPath": "/tmp/solver_planning_domains_tmp_4CKg1JPQfz3GC/plan",
        "logPath": "/tmp/solver_planning_domains_tmp_4CKg1JPQfz3GC/log"
    }
}

Could you please help me out on figure out how could this happened?

@guanghuhappysf128
Copy link
Author

Here is the link for the domain and problem file. Got the same result when use online editor: http://editor.planning.domains/#edit_session=jVYVlhdoeRirKvL

@haz
Copy link
Contributor

haz commented May 19, 2020

Fascinating...

@nirlipo would the planner be adding a final step to reach the goal given that it's a non-standard one (negations and disjunctions).

@guanghuhappysf128 Keep in mind that you should only share read-only links from the editor (otherwise anyone with the link can start making edits!)

@haz
Copy link
Contributor

haz commented May 19, 2020

Btw, the error status there is due to us not being able to extract the grounded action schema for display -- not an error in trying to find a plan. This is why a plan shows, but in the online editor you don't have the full action descriptions for each step.

@nirlipo
Copy link
Contributor

nirlipo commented May 20, 2020

This is a technique used in preprocessing by FF-parser to handle disjunctive goal formulas, adding $n$ dummy actions reach-goal, whose preconditions is each of the n clauses in the disjunction.

For this domain with goal formula

(:goal
	    (and 
                    (not (isFood a5)) 
                    (not (isCapsule b1))
                    (or 
                               (not (isGhost a4)) 
                               (not (isGhost b4))
                     )
             )
)

we get:

Action (REACH-GOAL)
	Pre(a) = {(NOT-ISFOOD A5), (NOT-ISCAPSULE B1), (NOT-ISGHOST B4)}
	Add(a) = {}
	Del(a) = {}
	Conditional Effects:
		cond_eff 1:
		Pre(cond_eff) = {}
		Add(cond_eff) = {GOAL-REACHED}
		Del(cond_eff) = {}
Cost = 1
Action (REACH-GOAL)
	Pre(a) = {(NOT-ISFOOD A5), (NOT-ISCAPSULE B1), (NOT-ISGHOST A4)}
	Add(a) = {}
	Del(a) = {}
	Conditional Effects:
		cond_eff 1:
		Pre(cond_eff) = {}
		Add(cond_eff) = {GOAL-REACHED}
		Del(cond_eff) = {}

and the goal of the problem is set to GOAL-REACHED.

@haz
Copy link
Contributor

haz commented May 20, 2020

So it was the disjunction in the end. The data-structures ok with multiple actions using the same name? Wild...

@nirlipo
Copy link
Contributor

nirlipo commented May 20, 2020

Better to be safe :) We map each action to a unique ID, just in case the parser generates groundings that PDDL wouldn't allow, like naming conventions.

@nirlipo
Copy link
Contributor

nirlipo commented May 20, 2020

This example in LAPKT is useful, as it gets pddl files and prints the output of FF-parser.

@haz
Copy link
Contributor

haz commented May 20, 2020

Beauty.

So @guanghuhappysf128 , I hope this makes it clear where/why things were breaking for you. I'm going to rename the issue title to address the fact that the solution parser could be a little more robust in what it extracts (so it should show the full actions for those it manages to extract, rather than failing outright). Thanks for reporting!

@haz haz changed the title Getting error while status is "ok" Return all of the ground actions possible instead of failing for just one May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants