Skip to content

GraphPlan doesn't always respect preconditions #1312

@eth-n

Description

@eth-n

Hi, I've been trying to use GraphPlan for some custom planning problems and have run into an issue. Linearizing the solution plan from GraphPlan doesn't always produce a valid plan. This is true even for the examples already in the code base. I've tried this so far with air_cargo and three_block_tower using the following:

from planning import *

prob = three_block_tower()
plan = linearize(GraphPlan(prob).execute())
print(plan)
try:
    for action in plan:
        prob.act(expr(action))
    if prob.goal_test():
        print("success")
    else:
        print("fail to obtain goal from actions")
except:
    print("fail on violated precondition")

Executing this code multiple times, one should see some successes and some failures which violate the preconditions. I tried creating problem objects and running GraphPlan on them in a loop, but that results in identical plans dropping out of the loop that either always succeed or always fail, again apparently randomly. Therefore it seems somewhat more "globally" stochastic, as in per Python process, rather than per-solve-attempt stochastic, if that makes sense.

Would be happy to find out this is user error! Thanks for any ideas and to those who take a deeper look.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions