panda-planner-dev / pandaPIparser

The parser of the pandaPI planning system
BSD 3-Clause "New" or "Revised" License
13 stars 10 forks source link

Support for Durative Actions #3

Closed viraj96 closed 3 years ago

viraj96 commented 3 years ago

Hi,

Based on the paper, I understood that HDDL was built on top of PDDL 2.1 EBNF. But I realized after using the language that it does not support durative-actions. I am not sure if I am correct or not, so I thought you could clarify this for me. If not, do you have an idea as to which files would need to be changed to support that within this parser? Any help is appreciated!

galvusdamor commented 3 years ago

Hi viraj,

Correct, the parser does not support durative actions. The reference the in paper should more correctly read "the non-temporal elements of PDDL 2.1". The parser, grounder, "our" planners that are based on the parser and grounder do not support temporal elements of actions, e.g. action durations or durative actions.

In you want to support durative actions you will probably have to change quite a lot in the parser. What exactly depends on what parts of PDDL 2.1 you want to use. The easiest case is if you are only interested in action durations. From the parser's perspective you can handle them like action costs (it is "just" a number attached to the action). The changes will happen in the src/hddl.y (that is the file that contains the actual file parser and the syntax of HDDL). Then you need to add a member to the parsed_method in the src/parsetree.hpp. Here the data structures are defined that result from parsing the file (and which are created in the src/hddl.y so you need to fill them there). Then you need to change the src/domain.cpp/hpp which translates the parsed representation into our simpler internal representation. Lastly you need to change the output (src/output.cpp) and everything connected to that (i.e. the following grounder and planners).

If you also want (in-between) effects or continuous effects in the durative action, you will have to change a lot more. Then the question becomes whether you want to stick to the pandaPIparser or whether you want to fork your own version of the parser and remove everything that you don't need. The purpose of pandaPIparser is to translate the HDDL input file into a more simple, machine-readable file format for the grounder. If you don't want or can't use the grounder afterwards, the question is what your target is. You may even just copy the raw file parser (src/hddl.y, src/hddl-token.l, src/parsetree.{cpp,hpp}) and use the datastructures it produces for your planner.

I hope that this answer answers (at lest some) of your questions. If you have any further, please feel free to ask!

Gregor

viraj96 commented 3 years ago

Thank you for the detailed response! For now, I will fork this repository and build support for durative actions on top of that. Thanks for giving information on the changes that might be required to complete the task.

viraj96 commented 3 years ago

Hello,

Just as a continuation, would you think that supporting resources would also entail a similar procedure? By resources, I mean something similar that ANML supports such as discrete/continuous and reusable/consumable types.

galvusdamor commented 3 years ago

Hi Viraj,

probably yes, sadly.