The purpose of this lab session is to understand the STRIPS formalism for representing planning problems. You will be requested to write down STRIPS-style descriptions of a problem, as well as solve some problems by using a planning system.
The planning system we are going to use is BlackBox.
It is already installed on the linux server russell.inf.unibz.it. A
Windows version is available from the BlackBox website, but it
requires Cygwin to work, so it
is not installed on the Windows boot PCs in the laboratory (see
details on Blackbox download page). You could reboot the PC into Linux and
download the executable or log into the application server
russel.inf.unibz.it
, where Blackbox is available in the
directory /home/AI/tools/BlackBox/
. A version of Blackbox compiled for MacOS X on Intel is available here. A brief introduction to the use of the
planner is available at the end of this document.
Init: On(A,Table) ^ On(B,Table) ^ On(C,Table)
^ Block(A) ^ Block(B) ^ Block (C)
^ Clear(A) ^ Clear(B) ^ Clear(C)
Goal: On(A,B) ^ On(B,C)
Action(Move(b,x,y),
PRECOND: On(b,x) ^ Clear(b) ^ Clear(y) ^ Block(b) ^ Block(y),
EFFECT: On(b,y) ^ Clear(x) ^
¬
On(b,x)
^
¬
Clear(y))
Action(MoveToTable(b,x),
PRECOND: On(b,x) ^ Clear(b) ^ Block(b),
EFFECT: On(b,Table) ^ Clear(x) ^
¬
On(b,x))
C
B A
------------This exercise is adapted from Exercise 11.4 from the textbook.
The monkey-and-bananas problem is faced by a monkey in a laboratory with some bananas hanging out of reach from the ceiling. A box is available that will enable the monkey to reach the bananas if he climbs on it. There are few labelled positions at which monkey, bananas and box can be. Moreover each object can have an height (e.g. bananas on the ceiling are high and box is low).
Initially, the monkey is at A, the bananas at B, and the box at C. The monkey and box have height Low, but if the monkey climbs onto the box he will have height High, the same as the bananas.
The actions available to the monkey include Go from one place to another, Push an object from one place to another, ClimbUp onto or ClimbDown from an object, and Grasp or Ungrasp an object. Grasping results in holding the object if the monkey and object are in the same place at the same height.
Write down the PDDL domain definition file for the problem.
Assume that there are three locations: A, B and C. Initially, the monkey is at A, the bananas at B, and the box at C. The monkey and box have height Low (on the floor), while bananas are High, since they hangs from the ceiling. At the end, Monkey wants to stay on the floor with the bananas.
Write down the problem instance as PDDL problem description file.
Use the BlackBox planning system to solve the problem.
;; STRIPS domain of the Air
cargo transport
(define (domain air-cargo)
(:requirements :strips)
(:predicates (In ?obj ?place)
(At ?obj ?place)
(Cargo ?obj)
(Plane ?obj)
(Airport ?obj))
(:action LOAD
:parameters (?c ?p ?a)
:precondition (and (At ?c ?a) (At ?p ?a)
(Cargo
?c) (Plane ?p) (Airport ?a))
:effect (and (not (At ?c ?a)) (In ?c ?p)))
(:action UNLOAD
:parameters (?c ?p ?a)
:precondition (and (In ?c ?p) (At ?p ?a)
(Cargo
?c) (Plane ?p) (Airport ?a))
:effect (and (not (In ?c ?p)) (At ?c ?a)))
(:action FLY
:parameters (?p ?from ?to)
:precondition (and (At ?p ?from)
(Plane
?p) (Airport ?from) (Airport ?to))
:effect (and (not (At ?p ?from)) (At ?p ?to)))
)
;; STRIPS Instance problem
for the Air cargo transport
(define (problem pb1)
(:domain air-cargo)
(:objects C1 C2
P1 P2
SFO JFK)
(:init
;; types
(Cargo C1) (Cargo C2)
(Plane P1) (Plane P2)
(Airport SFO) (Airport JFK)
;; locations
(At C1 SFO) (At C2 JFK) (At P1 SFO) (At P2 JFK))
(:goal
(and (At C1 JFK) (At C2 SFO))))
(and
....)
/home/AI/tools/BlackBox/blackbox
.
Among others, it accepts the options '-o' to specify the domain
definition file, and the option '-f' for the problem instance. An
example of the interaction is the following:/home/AI/tools/BlackBox/Examples/logistics-strips
on russel or here.