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