1

在 PDDL 的驱动程序日志域中,我们指定了链接和路径。

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

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

谢谢!

4

1 回答 1

1

这些是用户定义的谓词:

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

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

两者linkpath都是将两个位置关联起来的二元谓词,大概是在可以从一个地方移动到另一个地方的时候。这种连接是单向的。

我从源代码中读到定义了以下操作:

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

因此,如果可以从一个地方到另一个地方,那么两个位置似乎有一个链接,如果可以从DRIVE-TRUCK一个地方到另一个地方,两个位置就有一个路径WALK

真的没有什么可说的了。

您不断获得的原因UNSAT是因为您将司机和卡车放置在两个不同的位置

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

由于s0和之间的唯一连接s2链接,因此司机不可能到达卡车(反之亦然)。这是因为 is 的前提条件,DRIVE-TRUCK(driving ?driver ?truck)BOARD-TRUCK驾驶员在卡车的同一位置时才设置。

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

于 2018-02-01T19:27:47.520 回答