Giter Site home page Giter Site logo

aquaplanning's People

Contributors

biotomas avatar domschrei avatar femigr avatar froleyks avatar jtrautmann avatar marvinwilliams avatar patrickhegemann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aquaplanning's Issues

Converting a state into a goal

I have a problem maybe somebody can help me with:
Given a GroundPlanningProblem and a State instance, I want to convert the State into a new Goal instance, using all atoms. My approach was getting the atom values by using the State.getAtoms() method. For each of the values, I need to build an Atom instance, so I just used the index in the atoms list as the ID because that seemed to be right. For the name, I first used just an empty string, but this didn't work in all cases. So I wanted to use the GroundPlanningProblem.getAtomNames() method, but it turned out that this list is smaller than the one returned by State.getAtoms(). I don't really understand how this can be. Maybe you could explain it?
But most importantly: Could you maybe explain how one can convert a State into a Goal instance?

Error while parsing domain with action costs

I have this code in my domain file:

    (:functions (total-cost) - number)

    (:predicates
        ;...

When trying to solve problems with Aquaplanning I get this error:

Parsing...
line 28:5 no viable alternative at input '(:predicates'
Parsing error in domain.pddl at (line 26, col. 31) until (line 26, col. 31):
Unrecognized or illegal token "(".

SatSolver getters

Hi, this is not an issue, more a pull request without code. Could you provide getters for the solver and model attributes in the SatSolver class? Or at least make these attributes protected? It would be less hacky to extend the SatSolver with some functions if we could access those attributes directly. Thanks.

Null Pointer Exception during grounding

Using the minimum example provided below, the following output is put out by Aquaplanning.
I believe it is caused by Operator.setEffect(AbstractCondition) not being called with a valid condition.

java -jar ./target/aquaplanning-0.0.1-SNAPSHOT-jar-with-dependencies.jar files/rubikscube/domainminimumproblem.pddl files/rubikscube/problemminimumproblem.pddl 
This is Aquaplanning - QUick Automated Planning.
Parsing ...
Parsing complete.

Grounding ...
An error occurred.
java.lang.NullPointerException
	at edu.kit.aquaplanning.grounding.Preprocessor.instantiateQuantifications(Preprocessor.java:137)
	at edu.kit.aquaplanning.grounding.Preprocessor.simplifyProblem(Preprocessor.java:91)
	at edu.kit.aquaplanning.grounding.Preprocessor.preprocess(Preprocessor.java:58)
	at edu.kit.aquaplanning.grounding.RelaxedPlanningGraphGrounder.ground(RelaxedPlanningGraphGrounder.java:42)
	at edu.kit.aquaplanning.Main.main(Main.java:99)

MinimumExample.zip

Test failures

I ran the TestPlanners test cases as it is without changing anything and the testDerivedPredicates() method returned an error message:

Testing domain "testfiles/derivedPredicates/domain1.pddl", problem "testfiles/derivedPredicates/p1.pddl".
Parsing ...
Grounding ...
Planning ...
0 : (turn4 o4)
1 : (turn4 o3)

[0,286] Error at step 1: Action (turn4 o4) PRE: { { AND (is-any) ¬(eq-o1-or-o2-or-o3 o4) } } POST: { {3} }} is not applicable in state { (_TRUE) }.

In the TestParallelPlanning test as it is without changing anything, the testParallelPlanner() method also returned invalid plans. This might be the same error as the above one. There were error for the rover domain like this one:

Testing planner on /home/jeremias/Programmieren/KIT/APS/aquaplanning/benchmarks/Rover/p03.pddl
[65,457] Error at step 7: Action (calibrate rover0 camera0 objective0 waypoint1) PRE: { {4, 25, 26, 27, 28} } POST: { {29} }} is not applicable in state { (available rover0) (can_traverse rover0 waypoint1 waypoint2) (visible waypoint1 waypoint2) (at rover0 waypoint2) (can_traverse rover0 waypoint1 waypoint5) (visible waypoint1 waypoint5) (available rover1) (at rover1 waypoint2) (can_traverse rover1 waypoint2 waypoint0) (can_traverse rover1 waypoint2 waypoint3) (visible waypoint2 waypoint3) (at rover1 waypoint3) (can_traverse rover1 waypoint2 waypoint5) (visible waypoint2 waypoint5) (equipped_for_imaging rover0) (calibration_target camera0 objective0) (visible_from objective0 waypoint1) (on_board camera0 rover0) (calibration_target camera1 objective0) (on_board camera1 rover0) (can_traverse rover0 waypoint2 waypoint0) (can_traverse rover0 waypoint2 waypoint1) (visible waypoint2 waypoint1) (can_traverse rover0 waypoint5 waypoint1) (visible waypoint5 waypoint1) (can_traverse rover1 waypoint0 waypoint2) (visible waypoint0 waypoint2) (can_traverse rover1 waypoint3 waypoint1) (visible waypoint3 waypoint1) (can_traverse rover1 waypoint3 waypoint2) (visible waypoint3 waypoint2) (can_traverse rover1 waypoint5 waypoint2) (visible waypoint5 waypoint2) (at_soil_sample waypoint5) (equipped_for_soil_analysis rover0) (store_of rover0store rover0) (empty rover0store) (at_rock_sample waypoint3) (equipped_for_rock_analysis rover1) (store_of rover1store rover1) (empty rover1store) (at_rock_sample waypoint5) (visible_from objective0 waypoint2) (visible_from objective0 waypoint5) (supports camera0 high_res) (supports camera1 high_res) (supports camera1 low_res) (can_traverse rover0 waypoint0 waypoint2) (can_traverse rover0 waypoint0 waypoint3) (visible waypoint0 waypoint3) (can_traverse rover0 waypoint0 waypoint4) (visible waypoint0 waypoint4) (can_traverse rover1 waypoint1 waypoint3) (visible waypoint1 waypoint3) (visible_from objective0 waypoint0) (at_lander general waypoint4) (channel_free general) (visible waypoint1 waypoint4) (visible waypoint3 waypoint4) (can_traverse rover0 waypoint3 waypoint0) (visible waypoint3 waypoint0) (can_traverse rover0 waypoint4 waypoint0) (visible waypoint4 waypoint0) (visible_from objective0 waypoint3) (visible_from objective0 waypoint4) (visible waypoint0 waypoint5) (visible waypoint5 waypoint0) (visible waypoint4 waypoint3) (visible waypoint4 waypoint1) (visible waypoint5 waypoint3) (visible waypoint3 waypoint5) (_TRUE) }.
Plan is valid:false

But there were also errors for the childsnack domain, though this looks to me like another problem - like an action from the rover domain was used:

Testing planner on /home/jeremias/Programmieren/KIT/APS/aquaplanning/benchmarks/Childsnack/p01.pddl
[126,501] Error at step 6: Action (navigate rover0 waypoint4 waypoint1) PRE: { {0, 1, 2, 3} } POST: { {4} ; NOT {1} }} is not applicable in state { (at_kitchen_bread bread1) (at_kitchen_content content1) (notexist sandw1) (notexist sandw2) (at tray1 kitchen) (at tray2 kitchen) (at tray3 kitchen) (at tray3 table1) (not_allergic_gluten child1) (waiting child1 table1) (_TRUE) }.
Plan is valid:false

Can you confirm these errors?

Expose faulty element when AST Parsing throws an Exception

So, I'm generally new to planning, so I probably ran a faulty domain file, but it passed the parser stage and crashed during AST Walking.

Now it's hard to see which statement caused the error and thus (if possible) it would be awesome to have a resolution from AST Element -> Source Line/Column. In it's current state I only know that my "FHead" is missing some types, but unfortunately that doesn't help me much.

For reference, here's the problem:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:657)
        at java.util.ArrayList.get(ArrayList.java:433)
        at edu.kit.aquaplanning.parsing.ProblemParser.enterFHead(ProblemParser.java:996)
        at edu.kit.aquaplanning.parsing.PddlHtnParser$FHeadContext.enterRule(PddlHtnParser.java:3247)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:42)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:25)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28)
        at edu.kit.aquaplanning.parsing.ProblemParser.parse(ProblemParser.java:173)
        at edu.kit.aquaplanning.Main.main(Main.java:98)

Domain:

; Numeric planning in practice is rather limited, because planners are limited, even though the spec is not.
; One of these issues is the cost optimization. For Fast-Downward, the cost metric needs to be called "total-cost"
; This domain used "total-distance" before, but apparently that is as illegal as using ":fluents" in the requirements
(define (domain mail)
    (:requirements :typing :negative-preconditions :equality :action-costs) ; Other synonyms for action costs  :numeric-fluents :fluents :action-costs)

    (:types location - object
            letter - object
    )

    (:constants mailbox - location)

    (:predicates
        (at ?l - location); If the Salesman is at the given location
        (canDropAt ?let - letter ?loc - location) ; Can the given letter be dropped at the location loc.
        ; this even allows us to drop letters at various locations
        (deliver ?let - letter) ; Used for the goal "deliver all letters".
        (batched ?let - letter) ; TODO: Use to simulate the stack.
    )

    (:functions
        (distance ?from ?to) - number
        ; Fast-Downward accepted (batch-count) without anything, but this seems to be the official form.
        (batch-count) - number
        (total-cost) - number
    )

    (:action goto
        :parameters (?from - location ?to - location)
        :precondition (and
            (at ?from)
            (not(at ?to)) ; Prevent useless loops/from == to
        )
        :effect (and
            (at ?to)
            (not (at ?from))
            (increase (total-cost) (distance ?from ?to))
        )
    )

    ; This is explicitly modelled, so that we can model things like recharging pauses
    ; TODO: Currently there is no modelling of the stack content, and as such, this method won't be used yet.
    ; The Planner has no reason to pick up letters.
    (:action pickup
        :parameters (?let - letter)
        :precondition (and
            (at mailbox)
            ; TODO: The following line is not supported by fast downward
            (<= (batch-count) 5)
        )
        :effect (and
            ; TODO: The following line is not supported by fast downward
            (increase (batch-count) 1)
        )
    )

    (:action drop
        :parameters (?let - letter ?loc - location)
        :precondition (and
            (at ?loc)
            (canDropAt ?let ?loc)
            ; TODO: The following line is not supported by fast downward
            (> (batch-count) 0)
        )
        :effect (and
            (deliver ?let)
            ; TODO: The following line is not supported by fast downward
            (decrease (batch-count) 1)
        )
    )
)

Thanks in Advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.