Link 和 PDDL 中的 Path 有什么区别?

What's the difference between Link and Path in PDDL?

在 PDDL 的 driverlog 域中,我们指定了链接和路径。

(define (domain driverlog)
  (:requirements :typing) 
  (:types         location locatable - object
        driver truck obj - locatable
  )
  (:predicates 
        (at ?obj - locatable ?loc - location)
        (in ?obj1 - obj ?obj - truck)
        (driving ?d - driver ?v - truck)
        (link ?x ?y - location) (path ?x ?y - location)
        (empty ?v - truck)
 )

它在问题中的定义方式是:

(define (problem DLOG-2-2-2)
    (:domain driverlog)
    (:objects
    driver1 - driver
    driver2 - driver
    truck1 - truck
    truck2 - truck
    package1 - obj
    package2 - obj
    s0 - location
    s1 - location
    s2 - location
    p1-0 - location
    p1-2 - location
    )
    (:init
    (at driver1 s2)
    (at driver2 s2)
    (at truck1 s0)
    (empty truck1)
    (at truck2 s0)
    (empty truck2)
    (at package1 s0)
    (at package2 s0)
    (path s1 p1-0)
    (path p1-0 s1)
    (path s0 p1-0)
    (path p1-0 s0)
    (path s1 p1-2)
    (path p1-2 s1)
    (path s2 p1-2)
    (path p1-2 s2)
    (link s0 s1)
    (link s1 s0)
    (link s0 s2)
    (link s2 s0)
    (link s2 s1)
    (link s1 s2)
    )

路径和链接有什么区别?我试图创建一个类似的问题但省略了路径并且我不断遇到无法解决的问题。如何正确定义路径?

谢谢!

这些是 user-defined 谓词:

(define (domain driverlog)
  ...
  (:predicates 
        ...
        (link ?x ?y - location) (path ?x ?y - location)
        ...
  )
 )

因此可以通过检查相应的模型来推断它们的语义。

linkpath 都是二元谓词,将两个位置 联系起来,大概是可以从一个地方移动到另一个地方。此连接是单向的。

我从 source code 中读到,定义了以下操作:

(:action DRIVE-TRUCK
  :parameters
   (?truck
    ?loc-from
    ?loc-to
    ?driver)
  :precondition
   (and (TRUCK ?truck) (LOCATION ?loc-from) (LOCATION ?loc-to) (DRIVER ?driver) 
   (at ?truck ?loc-from)
   (driving ?driver ?truck) (link ?loc-from ?loc-to))
  :effect
   (and (not (at ?truck ?loc-from)) (at ?truck ?loc-to)))

(:action WALK
  :parameters
   (?driver
    ?loc-from
    ?loc-to)
  :precondition
   (and (DRIVER ?driver) (LOCATION ?loc-from) (LOCATION ?loc-to)
    (at ?driver ?loc-from) (path ?loc-from ?loc-to))
  :effect
   (and (not (at ?driver ?loc-from)) (at ?driver ?loc-to)))

所以看起来两个位置有一个link如果有可能DRIVE-TRUCK从一个地方到另一个,两个位置有一个路径如果可以WALK从一个地方到另一个地方。

真的没什么好说的了

你一直收​​到 UNSAT 的原因是因为你 将 driver 和卡车放在两个不同的位置:

(at driver1 s2)
(at driver2 s2)
(at truck1 s0)
(at truck2 s0)

由于 s0s2 之间的唯一联系是 link,因此 driver 不可能到达卡车(和 vice-versa)。这是因为 DRIVE-TRUCK 的前提条件是 (driving ?driver ?truck),如果 driver 与卡车处于同一位置,则仅由 BOARD-TRUCK 设置。

您可以通过在 s0s2 之间创建路径来解决此问题。但是,这似乎违反了模型的命名约定,该模型仅使用 link 互连 sX。更好的解决方案是改变初始状态,将卡车放在每个 driver 的相同位置,或者至少放在 WALK 动作可以到达的位置。