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

Add compile (grounding) options #40

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

Add compile (grounding) options #40

Core5563 opened this issue Dec 4, 2024 · 0 comments

Comments

@Core5563
Copy link

Core5563 commented Dec 4, 2024

As far as i have seen there are two options for compiling/grounding:
remove_statics_from_initial_state, remove_irrelevant_operators
which are True by default.
I have a use case where the problem is unsolvable and actions, which i still need, are being removed.
If possible i would like a way to configure these two settings.

Note: I have already tried to simply set these two values (setting the value in the _ground function).
engine.py 121:

task = _ground(prob,remove_statics_from_initial_state=False, remove_irrelevant_operators=False)

Unfortunately this leads to an error in "rewrite_back_task":
grounder.py 60:

grounded_problem.set_initial_value(vars_to_fluent_map[init], True)

KeyError: '(x)'

The used Problem (unified_planning.shortcuts.Problem) is defined as follows:

    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)
@Core5563 Core5563 changed the title Add compile (ground options) Add compile (grounding) options Dec 9, 2024
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

1 participant