PDDL 3.1
PDDL 3.1 is the language of the deterministic part of IPC 2008. Its two additions are object fluents, functions whose values are objects, and a small, standard way of giving actions costs.
Action costs
The requirement :action-costs allows a restricted use of numeric fluents. The only numeric effect is to increase a fluent called total-cost, numeric fluents cannot appear in conditions, and the metric, if any, minimises total-cost. That is simple enough for classical planners to support without handling numbers in general.
; PDDL 3.1 action costs: a single total-cost fluent, increased by actions
; and minimised by the metric.
(define (domain courier-costs)
(:requirements :typing :action-costs)
(:types van parcel location)
(:predicates
(road ?from ?to - location)
(van-at ?v - van ?l - location)
(parcel-at ?p - parcel ?l - location)
(in ?p - parcel ?v - van))
(:functions
(road-length ?from ?to - location) - number
(total-cost) - number)
(:action drive
:parameters (?v - van ?from ?to - location)
:precondition (and (van-at ?v ?from) (road ?from ?to))
:effect (and (not (van-at ?v ?from)) (van-at ?v ?to)
(increase (total-cost) (road-length ?from ?to))))
(:action load
:parameters (?p - parcel ?v - van ?l - location)
:precondition (and (van-at ?v ?l) (parcel-at ?p ?l))
:effect (and (not (parcel-at ?p ?l)) (in ?p ?v)
(increase (total-cost) 1)))
(:action unload
:parameters (?p - parcel ?v - van ?l - location)
:precondition (and (van-at ?v ?l) (in ?p ?v))
:effect (and (not (in ?p ?v)) (parcel-at ?p ?l)
(increase (total-cost) 1))))(define (problem cheapest-route)
(:domain courier-costs)
(:objects
van1 - van
book - parcel
depot market bypass harbour - location)
(:init
(van-at van1 depot)
(parcel-at book depot)
(road depot market) (road market harbour)
(road depot bypass) (road bypass harbour)
(= (road-length depot market) 3) (= (road-length market harbour) 9)
(= (road-length depot bypass) 5) (= (road-length bypass harbour) 4)
(= (total-cost) 0))
(:goal (parcel-at book harbour))
(:metric minimize (total-cost)))The route through the market starts shorter but totals 12. The bypass totals 9, and that is the one Autoplan takes. total-cost must be set to 0 in :init.
Object fluents
A function can now have an object as its value, declared with that type after -. Where earlier versions would write a predicate such as (van-at ?v ?l) and rely on actions to keep it to one location each, an object fluent says it outright: a van has one position.
(define (domain courier-object-fluents)
(:requirements :typing :equality :object-fluents)
(:types van parcel location)
(:predicates (road ?from ?to - location))
(:functions
(position ?v - van) - location
(carried-by ?p - parcel) - van)
(:action drive
:parameters (?v - van ?from ?to - location)
:precondition (and (= (position ?v) ?from) (road ?from ?to))
:effect (assign (position ?v) ?to)))The value is set in :init with =, and assign changes it, including to undefined. Comparing a function term in a condition, as drive does, needs :equality.
Autoplan does not support object fluents yet, and refuses this file. We have not run this example with any planner: it follows the syntax of the IPC 2008 pages cited below.
Changes to the flags
:numeric-fluentsis new, and takes on the old meaning of:fluents.:object-fluentsis new.:fluentsnow means both of these together.:action-costsis new.- Functions should declare their type, with
- numberfor numbers. Leaving it implicit is deprecated.
Sources
- Changes in PDDL 3.1. IPC 2008 deterministic part.
- Modeling Action Costs in IPC-2008. IPC 2008 deterministic part.