1

使用案例

首先,我想解释一下我的使用案例:我想将一个领域划分为不同的扇区,所有的植物都应该由机器人分析(每个扇区只有一个机器人)。我想检查:前提条件是已经分析了一个部门的所有植物,以便机器人返回“家”。

问题

这是域 PDDL。我的问题是放在“tracker-back-home”动作的前提下。现在我正在检查是否已经分析了所有植物,但我需要知道是否分析了特定部门的所有植物可以使用 forall 语句吗?

(define (domain killbee)
(:requirements :strips :typing)
(:types 
  bee location - object
  ;Inheritance
  tracker - bee
  hive plant sector - location
)
(:predicates 
  (directly-connected ?l1 - location ?l2 - location)
  (at ?l1 - object ?l2 - object) ;location is hive, plant or sector
  (free-sector ?s - sector)
  (bee-with-sector ?b - tracker)
  (tracker-ready-to-move ?b - tracker)
  (analyzed-plant ?p - plant ?s - sector)
  (sector-tracked ?s - sector)
  (plant-in-sector ?p - plant ?s - sector)
)
...
...
(:action tracker-back-home
:parameters (?b - tracker ?p - plant ?h - hive ?s - sector)
:precondition 
  (and (tracker-ready-to-move ?b)
  (at ?b ?p)
  (not (at ?b ?h))
  (forall (?x - plant) (analyzed-plant ?x ?s)))
  )
:effect 
  (and 
  (not (at ?b ?p))
  (at ?b ?h)
  (sector-tracked ?s)
  (not (bee-with-sector ?b))
  (free-sector ?s))
)...
4

1 回答 1

1

您是否检查过 PDDL 2.1 定义的语言功能“暗示”?(也许它已经在 2.1 之前定义了——不确定。)有了它,你可以定义:

(forall (?pPrime - plant)
  (imply (at ?s ?pPrime) (analyzed-plant ?pPrime ?s))
)

注意:我不确定参数的顺序是否(at ?s ?pPrime)正确。它应该对工厂?pPrime在扇区中进行编码?s

该条件扩展到大量含义,读取所有植物p'(无论它们在哪里)都成立:“ if plant p' is in s, then it's analyzed in s”。这应该准确地编码您正在寻找的内容。

于 2019-04-22T14:37:03.063 回答