0

I am implementing a system in pddl and i have to use durative-action, this is my code, but it gives me the error of the title.

(define (domain rooms)
(:requirements  :strips :typing  :durative-actions )
(:types
  room
  zone
  robot
  door
  elevator
)

(:predicates
  (robot_at ?r - robot ?x - room)
  (robot_at_zone ?r - robot ?x - room ?z - zone)
  (zone_at_room ?z - zone ?x - room)
  (is_next ?x - room ?y - room)
  (is_in_other_floor ?x - room ?y - room)
  (door_closed ?d - door ?x - room ?y - room)
  (door_opened ?d - door ?x - room ?y - room)  
)

(:durative-action go_room
  :parameters (?r - robot ?x - room ?y - room  ?d - door)
  :duration (= ?duration 5)
  :condition 
    (and  
      (robot_at ?r ?x)  
      (is_next ?x ?y)
      (door_opened ?d ?x ?y)
    )
  :effect 
    (and 
      (robot_at ?r ?y) 
      (not (robot_at ?r ?x))
    )
)

Ravi Saroch
  • 934
  • 2
  • 13
  • 28

1 Answers1

1

you need to specify when conditions and effects take place using the keywords at start, at end or over all (over all is valid for conditions only).

For example:

(:durative-action go_room
  :parameters (?r - robot ?x - room ?y - room  ?d - door)
  :duration (= ?duration 5)
  :condition 
    (and  
      (at start (robot_at ?r ?x)) 
      (over all (is_next ?x ?y))
      (over all (door_opened ?d ?x ?y))
    )
  :effect 
    (and 
      (at end (robot_at ?r ?y))
      (at start (not (robot_at ?r ?x)))
    )
)
Chiara
  • 26
  • 2