Giter VIP home page Giter VIP logo

pyddl's Introduction

PyDDL

STRIPS planner with PDDL-like problem specification in Python

by Gary Doran ([email protected])

Installation

PyDDL can be installed using pip:

pip install -e git+https://github.com/garydoranjr/pyddl.git#egg=pyddl

or by running the setup script:

python setup.py install

About

This is a STRIPS-like planner that I wrote for an AI class assignment. A planning domain and problem is specified in Python, in a manner that is intended to be reminiscent of PDDL. However, only a small subset of PDDL-like constructs are implemented. Planning is performed using A* search, but not too much trouble has been taken to optimize the search efficiency. Therefore, PyDDL is best suited for smaller problems.

Usage

A planning domain is specified as a Domain object, and takes a list of Action objects. Unlike PDDL, predicates do not need to be explicitly defined. An Action takes a list of arguments similar to that for PDDL. For example, see the eight-puzzle example script containing the following action:

Action(
    'move-up',
    parameters=(
        ('tile', 't'),
        ('position', 'px'),
        ('position', 'py'),
        ('position', 'by'),
    ),
    preconditions=(
        ('dec', 'by', 'py'),
        ('blank', 'px', 'by'),
        ('at', 't', 'px', 'py'),
    ),
    effects=(
        neg(('blank', 'px', 'by')),
        neg(('at', 't', 'px', 'py')),
        ('blank', 'px', 'py'),
        ('at', 't', 'px', 'by'),
    ),
),

One difference from PDDL here is that parameters are typed using (type, name) tuples rather than specifying types with predicates.

Similarly, a planning problem is specified with a Problem object, which takes a planning domain, a dictionary of typed objects, a list of initial predicates, and a list of goal predicates.

Once a problem has been constructed, it can be passed to the planner function with optional arguments (e.g. a search heuristic) to generate a plan (if one exists). The resulting plan is a sequence of Action objects to execute, or None if no plan exists.

PyDDL supports some basic numeric functions, comparisons, and operations. See the "missionaries and cannibals" problem for example usage.

pyddl's People

Contributors

garydoranjr avatar serin-delaunay avatar

Watchers

 avatar  avatar

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.