大概说一下题目:
机器人要先去开灯,然后到游客处给游客讲解,标有“小心地滑”的地方和动物区域不能去
可用PDDL Editor在线运行
其PDDL如下:
domain file:
(define (domain museum-domain)
(:requirements :strips)
(:predicates (at ?x ?y) (adj ?x ?y) (lights ?x) (wet ?y) (ro ?x) (cu ?x) (helped ?x))
(:action turnOn
:parameters (?a)
:precondition (and (ro ?a)
(ro ?a)
(at ?a sq-1-1)
(not (lights on)))
:effect (and (lights on)))
(:action talk
:parameters (?a ?loc ?to)
:precondition (and (at ?a ?loc)
(at ?to ?loc)
(ro ?a)
(cu ?to)
(lights on))
:effect (and (helped ?to)))
(:action move
:parameters (?a ?from ?to)
:precondition (and (at ?a ?from)
(adj ?from ?to)
(not (wet ?to))
(ro ?a))
:effect (and (not (at ?a ?from)) (at ?a ?to)))
)
problem file:
(define (problem museum-problem)
(:domain museum-domain)
(:objects sq-0-0 sq-0-1 sq-0-2 sq-0-3
sq-1-0 sq-1-1 sq-1-2 sq-1-3
robot customer1 customer2 customer3 on)
(:init (adj sq-0-0 sq-1-0) (adj sq-1-0 sq-0-0)
(adj sq-0-0 sq-0-1) (adj sq-0-1 sq-0-0)
(adj sq-0-1 sq-0-2) (adj sq-0-2 sq-0-1)
(adj sq-0-2 sq-0-3) (adj sq-0-3 sq-0-2)
(adj sq-0-3 sq-1-3) (adj sq-1-3 sq-0-3)
(adj sq-1-0 sq-1-1) (adj sq-1-1 sq-1-0)
(adj sq-1-1 sq-1-2) (adj sq-1-2 sq-1-1)
(adj sq-1-2 sq-1-3) (adj sq-1-3 sq-1-2)
(wet sq-0-1)
(not (lights on))
(at robot sq-1-0)
(ro robot)
(cu customer1) (cu customer2) (cu customer3)
(at customer1 sq-0-0) (at customer2 sq-0-2) (at customer3 sq-1-2)
)
(:goal (and (lights on) (helped customer1) (helped customer2) (helped customer3)))
)
PDDL在线运行
其结果为:
planning file:
(:action move
:parameters (robot sq-1-0 sq-1-1)
:precondition
(and
(at robot sq-1-0)
(adj sq-1-0 sq-1-1)
(not
(wet sq-1-1)
)
(ro robot)
)
:effect
(and
(not
(at robot sq-1-0)
)
(at robot sq-1-1)
)
)