Practicum 3: PDDL planning#
Practicum date: Tuesday, February 24, 2026, 23:59
Course: RO47014 Knowledge Representation and Symbolic Reasoning, TU Delft, CoR
Instructors: Carlos Hernandez Corbato, email: c.h.corbato@tudelft.nl
This practicum will help you familiarize yourself with PDDL to model and solve planning problems. You will do a simple exercise with an online PDDL editor and solver.
You do not need to deliver anything regarding this practical, but doing these exercises will greatly help you with this week’s assignment.
The PDDL Editor online#
In this practicum and related homework assignment, you will use the PDDL Editor[^1] to model and solve a planning problem.
Adding files#
This online editor allows you to write PDDL domain and problem
formulations, and solve them with available planners. You can add new
files in File > New and rename the files by double-clicking on them.
Stick to the standard names domain.pddl and problem.pddl. To solve
the problem after writing your PDDL files, simply click Solve > Plan.
The solver will either provide a valid plan or give you some debugging
information.
Simple PDDL exercise#
With this exercise, you will familiarize yourself with PDDL by writing
domain.pddl and problem.pddl files and generating solutions using
the PDDL Editor. Imagine you are in charge of the stage lighting
instruments to illuminate important live performances at international
concerts. Your task for a particular venue in Rotterdam is to make sure
that all 5 available stage lights are ON whenever the artist enters
the stage. A colleague of yours provided you with the following PDDL
files to solve the problem for a generic venue with 5 lights:
PDDL Editor template: http://editor.planning.domains/#read_session=Cn6oRtZk80
Unfortunately, the electrical system in Rotterdam was not installed
properly and you cannot independently switch ON and OFF single lights as
you please. In particular, a light can be switched ON if and only if
there is already another adjacent light ON. Your task is to modify the
given domain.pddl and problem.pddl templates and generate a plan to
turn ON all the lights respecting the constraints. The initial state is
the following:
Initial state: {off, on, off, off, on}
Assumption: at least one light is ON at the initial state.
Exercise: Modelling in PDDL Ranstad Railway (from lecture slides)#
This in a more complex PDDL modelling exercise, proposed in the lecture slides by Issa Hanou.
The complete exercise consists of modelling the problem given by Figure Fig. 2
Fig. 2 PDDL Exercise Railway Randstad#
Where the goal is to get everyone to Delft, the train starts at Amsterdam, with a capacity of 60 passengers, and the initial demand of people to get to Delft from each station is shown in blue in the figure.
Let’s start by modelling a simplified version of this problem in which the train has infinite capacity, and we do not care abot the distance travelled as long as all the people get to Delft.
Using this domain.pddl file:
(define (domain trains)
(:requirements :strips :fluents)
(:predicates
(at ?loc)
(link ?loc1 ?loc2)
)
(:functions
(passengers) - number
(people ?loc) - number
(distance ?loc1 ?loc2) - number
(capacity) - number
)
(:action travel
:parameters (?orig ?to)
:precondition (and
(at ?orig)
(link ?orig ?to)
)
:effect (and
(at ?to)
(not (at ?orig))
)
)
(:action load
:parameters (?city)
:precondition (and
(at ?city)
; (<= (+ ?boarding (passengers)) (capacity))
)
:effect (and
(increase (passengers) (people ?city))
(assign (people ?city) 0) ; assume all people in the city board the train
)
)
(:action unload
:parameters (?city)
:precondition (and
(at ?city)
;(<= ?boarding passengers)
)
:effect (and
(assign (passengers) 0)
(increase (people ?city) (passengers))
)
)
)
and the following problem.pddl file:
(define (problem everyone2delft)
(:domain trains)
(:objects
leiden delft rotterdam denhaag amsterdam utrecht schiphol
)
(:init
(at amsterdam)
(= (passengers) 0)
(link delft rotterdam)
(link rotterdam delft)
(link delft denhaag)
(link denhaag delft)
(link leiden delft)
(link delft leiden)
(link amsterdam leiden)
(link leiden amsterdam)
(link amsterdam utrecht)
(link utrecht amsterdam)
(link amsterdam schiphol)
(link schiphol amsterdam)
(link schiphol utrecht)
(link utrecht schiphol)
(link schiphol rotterdam)
(link rotterdam schiphol)
(link utrecht denhaag)
(link denhaag utrecht)
(link utrecht leiden)
(link leiden utrecht)
(link utrecht rotterdam)
(link rotterdam utrecht)
(= (people amsterdam) 20)
(= (people utrecht) 20)
(= (people schiphol) 25)
(= (people leiden) 15)
(= (people denhaag) 15)
(= (people rotterdam) 20)
(= (people delft) 0)
)
; total people 115
(:goal
(>= (people delft) 115)
)
)
we obtain with the ENHSP planner (in approx 3 secs.) a very inefficient plan that achieves the goal in 108 actions.