0

我正在 pddl 中实现一个系统,我必须使用持续动作,这是我的代码,但它给了我标题的错误。

(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))
    )
)

4

1 回答 1

1

您需要使用关键字指定条件和效果何时发生at startat end或者over all(总体上仅对条件有效)。

例如:

(: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)))
    )
)
于 2021-03-09T16:32:50.427 回答