PDDL: The planutils
server
In the previous post I mentioned the planutils
project as an easy way to try several PDDL planners. Today I learned about the planutils
server, a simple Flask app that exposes an HTTP API to invoke planners remotely, and I thought it's a brilliant idea. As of now, the API can only be used to get information on installed planners and to invoke each of them with its basic parameters, namely the PDDL domain and problem.
The nice thing about it is that there is a setup script to set up a planutils
server Docker container with a few representative planners (among which OPTIC for PDDL3 support, ENHSP-2020 for numeric planning, and TFD for temporal planning) and an exposed port (5555 by default).
With the server container running, the API can be used with any usual tool. An example with curl
could be like this:
curl -s -H "Content-Type: application/json" -d "{\"domain\": \"$(cat domain.pddl | tr '\n' ' ')\", \"problem\": \"$(cat problem.pddl | tr '\n' ' ')\"}" localhost:5555/package/enhsp-2020/solve
In this example, the two PDDL files are converted to strings and passed to the ENHSP-2020 planner as JSON values.
I will shortly put all this in a GitHub repo along with some example PDDL files for reference.