Defining the Domain
Let’s start by defining in the filelogistics.pddl the domain and its components:
- The requirements
- The types
- The predicates
- The actions or operators
logistics.pddl
Requirements
The requirements for this logistics example are:- strips: The actions will only use positive preconditions (predicates that must be true in the current state to trigger actions) and deterministic effects (effects that necessarily follow action triggering).
- typing: We will use “types” like in OO programming to represent sets of objects in the world.
logistics.pddl
Types
We will use the following types:- Places, cities and physical objects are considered as objects
- Packages and vehicles are physical objects
- Trucks and airplanes are vehicles
- Airports and locations are places
logistics.pddl
Predicates
We will use the following predicates:in-city(loc, city)- true iff a placelocis in the citycityat(obj, loc)- true iff a physical objectobjis at placelocin(pkg, veh)- true iff a packagepkgis in a vehicleveh
logistics.pddl
Operators
We define the operators (actions) of the logistics domain. The domain has 6 operators:load-truck, load-airplane, unload-truck, unload-airplane, drive-truck and fly-airplane.
Load Truck
To load a truck, we need a package and a truck at the same place. The effect is that the package is now in the truck and no longer at the location.logistics.pddl
Load Airplane
logistics.pddl
Unload Truck
logistics.pddl
Unload Airplane
logistics.pddl
Fly Airplane
logistics.pddl
Drive Truck
logistics.pddl
Action preconditions and effects can be more complex:
- Quantified:
(forall (?v1 ... ?vn) <effect>)requires the:adlrequirement - Conditional:
(when <condition> <effect>) - Actions can also have costs, duration, and time constraints
Defining the Problem
Now let’s define in the fileproblem.pddl the problem instance:
problem.pddl
Objects
problem.pddl
Initial State
The initial state is a set of ground predicates (all variables bound to objects). Facts not listed are assumed false:problem.pddl
Goal Description
The goal is to have package p1 at north and package p2 at south:problem.pddl
Solution
Running a PDDL planner produces the following plan:Plan Output

