Giter VIP home page Giter VIP logo

mypddl's Introduction

myPDDL - A Modular Knowledge Engineering Tool for PDDL

Join the chat at https://gitter.im/Pold87/myPDDL

Download accompanying paper:

Planning in the Wild: Modeling Tools for PDDL. The final publication is available at Springer via http://dx.doi.org/10.1007/978-3-319-11206-0_27.

myPDDL is a highly customizable and extensible modular system, designed for supporting knowledge engineers in the process of writing, analyzing and expanding PDDL files and thereby promoting the collaboration between knowledge engineers and the use of PDDL in real-world applications. It consists of the following integral parts:

  • myPDDL-new: Create a myPDDL project folder structure with PDDL domain and problem skeletons.
  • myPDDL-syntax: A context-aware syntax highlighting feature.
  • myPDDL-snippet: Code snippets (templates), which can be inserted in myPDDL files.
  • myPDDL-distance: Automated distance calculation for PDDL locations, specified in a problem file.
  • myPDDL-diagram: A type diagram generator for analyzing the structure of myPDDL type hierarchies.
  • myPDDL-IDE: An integrated development environment for the use of myPDDL in Sublime Text.

Supported file types

  • .pddl

Installation

Requirements:

  • Graphviz (command line tool dot)
  • Java
  • ...

Simply place this repository into your Sublime text packages folder (Preferences -> Browse Packages...). You have three possibilities to do so:

IMPORTANT

You have to take a few more steps to enjoy all functionalities of myPDDL. I assume you are using Linux:

  1. Go to the Sublime Text Packages folder (Preferences -> Browse Packages ...) and change to the myPDDL folder.

  2. Ensure that the file myPDDL (inside the folder myPDDL) is executable (type chmod a+x myPDDL in your shell).

  3. Place the file myPDDL somewhere on your $PATH (e.g. ~/bin) or add the folder myPDDL to your $PATH (e.g. add export PATH=$PATH:~/.config/sublime-text-2/Packages/myPDDL to your .bashrc).

  4. Open the file myPDDL in a text editor and customize it: While most options are for advanced users can should set the variable "path" to match the corresponding myPDDL folder. The default is probably right for you: "~/.config/sublime-text-2/Packages/myPDDL".

  5. Enjoy (in Sublime Text):

    1. Create new projects - open the command palette (ctrl+shift+p) and choose myPDDL-new. Specify the name for the project and press enter -> A new project structure with templates will be generated in your PDDL project directory (the project directory defaults to /Documents/myPDDL but you can choose a different folder by setting "pddl_project_folder": "/Documents/myPDDL/". You should also customize the command for running Sublime Text (normally one of subl, sublime, sublime-text) "sublime_shell_cmd": "subl").
    2. Switch to PDDL syntax highlighting: View -> Syntax -> PDDL
    3. Use snippets: type domain and press tab -> a domain skeleton appears (you can find all snippets below)
    4. Display a PDDL type diagram: open the command palette (ctrl+shift+p and choose myPDDL-diagram)
    5. Calculate distances between PDDL predicates in a problem file specified by a predicate 'location' (you can choose a different name for this predicate in the myPDDL (NOT myPDDL.py) file in your $PATH).

Customization

You can customize almost anything. Use a different image viewer by changing the variable "viewer" in the myPDDL file on your $PATH or customize the templates for the domain files of myPDDL-new (in the folder templates).

Usage

You can also use myPDDL via a command-interface (type myPDDL in a shell to see further information).

Use Snippets

This package contains some often used PDDL constructs. Try one of the following, to see how they work:

  • template: domain, problem
  • types: t1, t2, t3, etc.
  • predicates: p1, p2, p3, etc.
  • functions: f1, f2, f3, etc.
  • action: action, durative-action

Examples

Create PDDL Projects (myPDDL-new)

Within the project folder, the domain file domain.pddl and the problem file p01.pddl (within the folder problems/) initially contain corresponding PDDL skeletons which can also be also customized. Additionally the project name is used as the domain name within the files domain.pddl and p01.pddl.

Syntax Highlighting (myPDDL-syntax)

alt text

A deliberately erroneous domain. Constructs not specified by PDDL are not highlighted.

Type Diagram Generation (myPDDL-diagram)

alt text

Automatically generated type diagram of the Hacker World

Every time myPDDL-diagram is invoked, the names of the saved files are extended by an ascending revision number. Thus, one cannot only identify associated PDDL and diagram files, but also use this feature for basic revision control.

Distance Calculation (myPDDL-distance)

Before using the calculator the problem file looks like this (p01.pddl):

(:init ...
       (location gary 4 2)
       (location pizza 2 3))

After the application, the distances have been added in a new file (p01-location.pddl):

(:init ...
       (location gary 4 2)
       (location pizza 2 3)
       (distance gary gary 0.0)
       (distance gary pizza 2.2361)
       (distance pizza gary 2.2361)
       (distance pizza pizza 0.0))

Volker Strobel - [email protected] - 2014

mypddl's People

Contributors

gitter-badger avatar pold87 avatar whancock avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mypddl's Issues

Problem on syntax highlight when combining :adl and :durative-actions)

Hi,
I think there can be a problem when combining durative actions and ADL constructions (forall and exists), as the syntax highlight stops working. However, the domain is correct for the planner (sgplan). Using both separately there's no problem at all. I send you by e-mail and screen capture and the project files.

Congratulations for the tool! Is very useful. Thanks!

Unable to generate Diagram

Hello!

i have a conditional planning domain but the diagram returns as a diagram an empty white box.
I do not get any errors it seems to be running correct but doesn't generate anything.
Do you have any idea what might be causing that?

Thank you

Unable to generate Diagrams

Hi,

I tried generating the diagrams from the terminal and I get this error:

An error occured. Please check that: delivery.pddl is a correct PDDL domain file containing no bracket errors.

When I check the errors log, I get:

Exception in thread "main" java.io.IOException: Cannot run program "dot" (in directory /Users/aliciabeylan/Documents/KCL/FYP 4/PDDL"): error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at java.base/java.lang.Runtime.exec(Runtime.java:635) at clojure.java.shell$sh.doInvoke(shell.clj:116) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:617) at me.raynes.fs$exec.doInvoke(fs.clj:472) at clojure.lang.RestFn.invoke(RestFn.java:482) at mypddl.core$_main.doInvoke(core.clj:286) at clojure.lang.RestFn.applyTo(RestFn.java:137) at mypddl.core.main(Unknown Source) Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:339) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:270) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) ... 10 more

I followed the instructions but I might have done something wrong. Any ideas?

Thanks!

How to generate the PDDL diagram

Hello,

This is not really an issue but a question. When you generate a PDDL diagram from sublime text, where is the diagram stored? How do I know it was generated?

Thank you,

zeid

Works with Sublime Text 3

Thank you for an awesome plugin/tool. Just wanted to note that it works really well with Sublime Text 3 as well as previous versions.

Cheers,
Nap

name 'myPDDL' is not defined

Hello!

I am trying to use myPDDL in Sublime, but when trying to calculate the distance, I find the following error:

myPDDL-distance
Traceback (most recent call last):
File "", line 1, in
NameError: name 'myPDDL' is not defined
Exception in thread Thread-6:
Traceback (most recent call last):
File "./python3.3/threading.py", line 901, in _bootstrap_inner
File "/home/newarney/.config/sublime-text-3/Packages/myPDDL/mypddl.py", line 40, in run
subprocess.Popen([self.mypddl_cmd, "distance", self.file_name])
File "./python3.3/subprocess.py", line 819, in init
File "./python3.3/subprocess.py", line 1386, in _execute_child
TypeError: Can't convert 'NoneType' object to str implicitly


I am using Ubuntu 18.04.3 LTS OS (64 bit).

Thank you!

Support for Processes & Events

I use processes & events all the time but there are no PDDL syntax highlighting packages that support it ๐Ÿ˜ข

The syntax is similar to that of actions:

	(:process foo
		:parameters (bar)
		:precondition (dummy)
		:effect (increase (nutella-sandwiches) 1.0)
	)

and

	(:event foo
		:parameters (bar)
		:precondition (> (nutella-sandwiches) 10)
		:effect (assign (nutella-sandwiches) 0)
	)

Support for Atom

Hello,

I was wondering if it would be possible to bring myPDDL support for syntax highlighting to Atom (https://atom.io). This would be a really great feature, something I think a lot of people in AI would appreciate.

Thanks,
Nick

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.