Skip to content

Configuring the PDDL planner

Jan Dolejší edited this page Nov 12, 2020 · 14 revisions

PDDL Planners

End users can configure the PDDL extension to use their own PDDL planner. There are two shapes of planners supported:

  • planner executables
  • planning service

To configure a planner, invoke the PDDL: Configure PDDL planner command (using Ctrl+Shift+P) and follow the instructions.

For planner executables, the relevant configuration will be stored in following settings:

  • pddlPlanner.executableOrService (mandatory settings pointing to the executable/command)
  • pddlPlanner.executableOptions (optional specification of command line arguments)
  • pddlPlanner.epsilonTimeStep (optional epsilon time step value defaulted to 0.001)

For planner service, specify the url into the pddlPlanner.executableOrService setting e.g. http://solver.planning.domains/solve. If you are interested to build your own service, implement the interface documented here: http://solver.planning.domains/. When implementing/hosting your own planning service, please expose it at a /solve to be recognized. The extension also supports a /request endpoint, which follows a asynchronous RESTful API, but that is not documented at this point. Let me know if there is interest.

Recommended configuration for commonly used PDDL planners

First, see the list of commonly used planners in the PDDL Reference.

Solver.planning.domains

The default PDDL solver is http://solver.planning.domains/solve. It is now built-into the extension and there is no need to configure it. However, saving its URL into pddlPlanner.executableOrService also work.

LPG

The LPG Planner is available among the out-of-the-box supported planners since November 2020. That means its command-line options are also presented in the drop down, while invoking the planner and the output plans are parsed and visualized:

LPG Planner Support

It is recommended to use the -noout argument to avoid the creation of plan files on disk.

PDDL4J

Pddl4j supports both parsing of propositional PDDL and (simple) planning. To use it as a parser, use following command (as pddlPlanner.executableOrService):

    java -javaagent:d:/tools/pddl4j/pddl4j-3.5.0.jar -server -Xms2048m -Xmx2048m fr.uga.pddl4j.planners.hsp.HSP

and command line options (pddlPlanner.executableOptions):

    $(planner) $(options) -o $(domain) -f $(problem)

where -o and -f are the switches expected by the planner.

POPF Planner

The POPF planner can be configured easily by selecting it from the types of out-of-the-box supported planners. Alternatively, pasting in the executable name to the pddlPlanner.executableOrService setting also works:

    popf.exe

This is assuming you have the location of the executable included into your %path% environment variable. Otherwise simply specify the full path.

... and use the default command line options (pddlPlanner.executableOptions setting):

    $(planner) $(options) $(domain) $(problem)

Configuring a custom planner

If you have a planner executable and want to use it with this VS Code extension, ensure its output adheres to this format:

; some other output that is not part of the plan
***cost***: number
***States evaluated***: number
time: (some-instantaneous-action-name args)
time: (some-durative-action-name args) [duration]
time: (some-durative-action-name args) [D:<duration>; C:<actionCost>]
; some other output that separates plans in the output

Where *** are any non-numeric characters. Alternatively to cost, the word metric will also be detected.

The planner may output multiple plans. They need to be separated in the output by a line that does not parse as a plan.

Working directory

The planner executable runs in the context of the directory, where the domain and problems are located. Therefore if the planner generates additional files (e.g. log files), they are easy to find.

Clone this wiki locally