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

Ground problem without removing actions/preconditions/effects #647

Open
Core5563 opened this issue Dec 9, 2024 · 0 comments
Open

Ground problem without removing actions/preconditions/effects #647

Core5563 opened this issue Dec 9, 2024 · 0 comments

Comments

@Core5563
Copy link

Core5563 commented Dec 9, 2024

User Story

I am currently working with this library and need to ground my problems.
Right now (as far as I know) there is no way to ground a problem in a way that does not remove preconditions and/or Actions.
The problems I am working with are unsolvable which I am trying to make solvable by removing preconditions.
Here is the problem: since all grounders remove actions/preconditions/effects while grounding (which is logical since the problem is assumed to be SOLVABLE) but I need a grounding option which does not remove anything i have missing actions.

Additional Material

This problem here is already "grounded" but for example using "pyperplan" (doesn't really matter all grounders do this)
grounding the task results in missing actions.

from unified_planning.shortcuts import Problem, Fluent, InstantaneousAction, BoolType, Compiler, CompilationKind
problem = Problem()
#variables
x = Fluent("x", BoolType())
y = Fluent("y", BoolType())
z = Fluent("z", BoolType())
p = Fluent("p", BoolType())
q = Fluent("q", BoolType())
#add variables and set initial values
problem.add_fluent(x, default_initial_value=True)
problem.add_fluent(y, default_initial_value=False)
problem.add_fluent(z, default_initial_value=False)
problem.add_fluent(p, default_initial_value=False)
problem.add_fluent(q, default_initial_value=False)
#add goals
problem.add_goal(p)
problem.add_goal(q)
#actions
a1 = InstantaneousAction("a1")
a1.add_precondition(x)
a1.add_precondition(y)
a1.add_effect(z, True)
a1.add_effect(p, True)
problem.add_action(a1)
a2 = InstantaneousAction("a2")
a2.add_precondition(z)
a2.add_effect(q, True)
problem.add_action(a2)
#ground problem
compiler = Compiler(name ="pyperplan")
compiler_result = compiler.compile(problem, compilation_kind = CompilationKind.GROUNDING)
print(compiler_result.problem)

The following result will miss the "a1" action

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

No branches or pull requests

1 participant