0

I am new to PDDL and I'm trying to do a robot cleaner problem but I don't understand why I'm getting this.

reading input... [t=0s] Simplifying transitions... done! done reading input! [t=0s] building causal graph...done! [t=0s] packing state variables...done! [t=0s] Variables: 1 Facts: 2 Bytes per state: 4 done initalizing global data [t=0s] Conducting best first search with reopening closed nodes, (real) bound = 2147483647 Initializing FF heuristic... Initializing additive heuristic... Simplifying 0 unary operators... done! [0 unary operators] Initial state is a dead end. Completely explored state space -- no solution! Actual search time: 0s [t=0s] Expanded 0 state(s). Reopened 0 state(s). Evaluated 1 state(s). Evaluations: 1 Generated 0 state(s). Dead ends: 0 state(s). Number of registered states: 1 Search time: 0s Total time: 0s Search stopped without finding a solution. Peak memory: 2936 KB

    (define (domain floor-tile)

        (:requirements :typing)

        ;; We have two types: robots and the tiles, both are objects
        (:types robot tile - object)

        ;; define all the predicates as they are used in the probem files
        (:predicates  

        ;; described what tile a robot is at
        (robot-at ?r - robot ?x - tile)

        ;; indicates that tile ?x is above tile ?y
        (up ?x - tile ?y - tile)

        ;; indicates that tile ?x is below tile ?y
        (down ?x - tile ?y - tile)

        ;; indicates that tile ?x is right of tile ?y
        (right ?x - tile ?y - tile)

        ;; indicates that tile ?x is left of tile ?y
        (left ?x - tile ?y - tile)

        ;; indicates that a tile is clear (robot can move there)
        (clear ?x - tile)

        ;; indicates that a tile is cleaned
        (cleaned ?x - tile)
        )

    (:action clear

          :parameters (?r - robot?x - tile ?y - tile)

          :precondition (and (robot-at ?r ?x) (clear ?x))

          :effect (when (cleaned ?x) (not(clear ?x)))
    )


    (:action clean-up

          :parameters (?r - robot ?x - tile ?y - tile)

          :precondition (and (up ?y ?x) (robot-at ?r ?x) (clear ?y))

          :effect (and (robot-at ?r ?y) (not(robot-at ?r ?x))) 
    )


     (:action clean-down

          :parameters (?r - robot?x - tile ?y - tile)

          :precondition (and (down ?y ?x) (robot-at ?r ?x) (clear ?y))

          :effect (and (robot-at ?r ?y) (not(robot-at ?r ?x)))
    )


     (:action up 
         :parameters (?r - robot?x - tile ?y - tile)

         :precondition (and (up ?y ?x) (robot-at ?r ?x) (clear ?y))

         :effect (and (robot-at ?r ?y) (not(robot-at ?r ?x))) 
    )


    (:action down 
         :parameters (?r - robot?x - tile ?y - tile)
         :precondition (and (down ?y ?x) (robot-at ?r ?x)(clear ?y))

         :effect (and (robot-at ?r ?y) (not(robot-at ?r ?x))) 
    )

    (:action right 
         :parameters (?r - robot?x - tile ?y - tile)

         :precondition (and (right ?y ?x) (robot-at ?r ?x) (clear ?y))

         :effect (and (robot-at ?r ?y) (not(robot-at ?r ?x)))    
    )

    (:action left 
         :parameters (?r - robot?x - tile ?y - tile)

         :precondition (and (left ?y ?x) (robot-at ?r ?x) (clear ?y))

         :effect (and (robot-at ?r ?y ) (not(robot-at ?r ?x)))
    )
    )

Problem:


    (define (problem prob001)
     (:domain floor-tile)
     (:objects tile_0-1 tile_0-2  
               tile_1-1 tile_1-2  
               tile_2-1 tile_2-2  - tile
               robot1 - robot
    )
     (: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)
    ))

    )

2 Answers2

0

Didn't look through everything in detail, but your PDDL has some obvious issues that could be fixed. E.g.,

  • Keep a space between and and the next element (i.e., (and(pred might cause an error)
  • Make sure you keep infix notation. This would be an error: (when and(cleaned ?x) (not(clear ?x))). Correct form would be (when (and (cleaned ?x)) (not(clear ?x))), or even better, (when (cleaned ?x) (not(clear ?x)))
haz
  • 625
  • 4
  • 12
0

The problem cannot be solved, as there is no way a tile could ever be cleaned.

If you look at the effects of the actions, none of them results in a cleaned tile. So the goal is unachievable. I assume you got the clear and clean predicates confused?

Oliver Mason
  • 2,240
  • 2
  • 15
  • 23
  • Yeah, I was. I also see now why it wasn't working, my robot had nothing to do, thanks. Took me a while to figure that out, but its working now. Thank you for helping! – SlendyKibbles Apr 15 '20 at 15:31