'PDDL is not compiling. Log files gave me a bunch of errors
I am very new to PDDL and I got an assignment due soon. For some reason, it is not compiling and keeps giving me errors but the log file is so messy and I can not find where I went wrong. Some help would really be appreciated.
The task is to write a PDDL domain that can solve a planning problem for floor cleaning robots. A set of robots has the task to clean floor tiles. The robots can move around the floor tiles in four directions (up, down, left, and right). Robots have a brush mounted at the front and at the back, so they can clean in front and behind them (up and down, respectively), but they cannot turn around. The robots, however, cannot drive on wet surfaces, so they must never drive onto tiles they have already cleaned (and are therefore wet). Besides, a robot cannot clean the tile where another robot is occupied. The task is to write a planning domain, which can solve this task for general environments.
This is the problem:
(define (problem prob001)
(:domain floor-tile1)
(:objects tile_0-1 tile_0-2
tile_1-1 tile_1-2
tile_2-1 tile_2-2
robot1
)
(:init
(robot-at robot1 tile_1-1)
(clear tile_0-1)
(clear tile_0-2)
(clear tile_1-2)
(clear tile_2-1)
(clear tile_2-2)
(up tile_1-1 tile_0-1)
(up tile_1-2 tile_0-2)
(up tile_2-1 tile_1-1)
(up tile_2-2 tile_1-2)
(down tile_0-1 tile_1-1)
(down tile_0-2 tile_1-2)
(down tile_1-1 tile_2-1)
(down tile_1-2 tile_2-2)
(right tile_0-2 tile_0-1)
(right tile_1-2 tile_1-1)
(right tile_2-2 tile_2-1)
(left tile_0-1 tile_0-2)
(left tile_1-1 tile_1-2)
(left tile_2-1 tile_2-2)
)
(:goal (and
(cleaned tile_0-1)
(cleaned tile_0-2)
(cleaned tile_1-1)
(cleaned tile_2-2)
))
)
The domain:
(define (domain floor-tile1)
(:requirements :typing :strips)
(:predicates (robot-at ?r ?x)
(up ?x ?y)
(down ?x ?y)
(right ?x ?y)
(left ?x ?y)
(clear ?x)
(cleaned ?x)
)
(:action clean-up
:parameters (?r ?toclean ?at)
:precondition (and
(up ?toclean ?at)
(down ?at ?toclean)
(clear ?toclean)
(robot-at ?r ?at)
(not (cleaned ?toclean))
)
:effect (cleaned ?toclean)
)
(:action clean-down
:parameters (?r ?toclean ?at)
:precondition (and
(down ?toclean ?at)
(up ?at ?toclean)
(not (cleaned ?toclean))
(clear ?toclean)
(robot-at ?r ?at)
)
:effect (cleaned ?toclean)
)
(:action up
:parameters (?r ?from ?to)
:precondition (and (up ?to ?from)
(down ?from ?to)
(clear ?to)
)
:effect (
(robot-at ?robot ?tt)
(not (clear ?to))
)
)
(:action down
:parameters (?r ?from ?to)
:precondition (and (down ?to ?from)
(up ?from ?to)
(clear ?to)
)
:effect (and
(robot-at ?r ?to)
(not (clear ?to))
)
)
(:action right
:parameters (?r ?from ?to)
:precondition (and (right ?to ?from)
(left ?from ?to)
(clear ?to)
)
:effect (and
(robot-at ?r ?to)
(not (clear ?to))
)
)
(:action left
:parameters (?r ?from ?to)
:precondition (and (left ?to ?from)
(right ?from ?to)
(clear ?to)
)
:effect (and
(robot-at ?r ?to)
(not (clear ?to))
)
)
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
