PDDL语法学习-Domain篇-4
作者:互联网
PDDL2.2的域语法向域添加了非常小的更改。但是,与对PDDL的任何更新一样,它引入了新的 requirements,但惟一的新语法是派生谓词,谓词的定义方式与 actions 的定义方式类似,并且在域文件的同一节中定义。
先引入一个简单的实例:
(define
(domain railways)
(:requirements :derived-predicates :timed-initial-literals)
(:types
train station - object
)
(:predicates
(train-not-in-use ?t - train)
(train-has-guard ?t - train)
(train-has-driver ?t - train)
(train-usable ?t - train)
)
(:functions
... - omitted
)
(:durative-action MOVE-TRAIN
... - omitted
)
(:derived (train-usable ?t - train)
(and
(train-has-guard ?t)
(train-has-driver ?t)
)
)
(:derived
... - omitted
)
)
内容:
- Requirements
- Deeived Predicates
- Timed Initial Literals
Requirements
(:requirements <requirement_name>)
Requirements 类似于编程语言中的import/include语句,但是由于PDDL是一种声明性语言,所以它是:作为给定规划器的 :requirement是“必需的”,以促进语言的某些实现。
这是PDDL2.2向PDDL语言添加的需求列表。
- :derived-predicates
- :timed-initial-literals
1、Derived Predicates:
(:derived <predicate_name> <logical_expression>)
派生谓词是通过命名派生结果的谓词来声明的,并通过计算逻辑表达式来计算值。
注意,派生谓词的声明类似于actions,因为派生谓词的每个声明都使用 :derived关键字。
(:derived (train-usable ?t - train)
(and
(train-has-guard ?t)
(train-has-driver ?t)
)
)
上面的例子指定了火车只有在有火车和司机的情况下才可用。
2、Timed Initial Literals:
(:requirements :timed-initial-literals)
允许在定义问题时使用定时初始字面值。
(at 10 (train-not-in-use t1))
References
- PDDL - The Planning Domain Definition Language, [Ghallab, M. Howe, A. Knoblock, C. McDermott, D. Ram, A. Veloso, M. Weld, D. Wilkins, D.]
- PDDL2.1: An Extension to PDDL for Expressing Temporal Planning Domains, [Fox, M. Long, D.]
- PDDL2.2: The Language for the Classical Part of the 4th International Planning Competition[Edelkamp, S. Hoffmann, J.]
- PDDL Examples
- OPTIC - Optimising Preferences and Time Dependent Costs
来自 <https://github.com/nergmada/pddl-reference/blob/master/docs/reference/PDDL2.2/domain.md>
标签:PDDL,Domain,requirements,PDDL2.2,derived,语法,train,谓词 来源: https://blog.csdn.net/abc455050954/article/details/98525180