开发规划算法时出现问题
Issue while developing a planning algorithm
我正在尝试使用 PDDL
开发算法。下面我试图定义域和问题文件
Domain File:
(define (domain sp)
(:requirements :typing)
(:types location agent item - object
robot human - agent
room - location
fruit cup table - item)
(:predicates
(at ?o - object ?l - location)
(detected ?p - human ?l - room)
(greeted ?r - robot ?p - human)
)
(:action detect
:parameters (?p - human ?i - item ?r - robot ?l - location)
:precondition (at ?r ?l)
:effect (and (at ?p ?l) (at ?r ?l))
)
(:action greet
:parameters (?r - robot ?p - human ?l - location)
:precondition (and (at ?r ?l) (detected ?p ?l))
:effect (greeted ?r ?p)
)
)
Problem File:
(define (problem test12)
(:domain sp)
(:objects person0 - Human
pepper0 - Robot
apple - Fruit
cup0 - Cup
table0 - Table
room0 - Room)
(:init
(at pepper0 room0)
)
(:goal (and
(detected person0 room0)
(greeted pepper0 person0)
)
)
)
我想要实现的是
- 机器人在房间里
- 当人进入房间时,机器人需要检测人
- 问候人类
- 它必须检测房间中的其他物体(如杯子、水果等)
当我运行这段代码时,我会出现以下错误。
solution-impossbible
ff: parsing domain file
domain 'SP' defined
... done.
ff: parsing problem file
problem 'TEST12' defined
... done.
ff: goal can be simplified to FALSE. No plan will solve it
我正确地遵循了语法,但它抛出了这个错误。我不知道该怎么做。谁能告诉我一个方向,如果可能的话,还有一些 PDDL
的调试资源?
输出本身不是错误。它只是表明您的问题没有计划。问题是 (detected ?p ?l)
永远不会被任何操作添加并且不处于您的初始状态,因此您永远无法实现它。您可能希望将其添加为 detect
操作的效果(而不是 (at ?r ?l)
?)。
我正在尝试使用 PDDL
开发算法。下面我试图定义域和问题文件
Domain File:
(define (domain sp)
(:requirements :typing)
(:types location agent item - object
robot human - agent
room - location
fruit cup table - item)
(:predicates
(at ?o - object ?l - location)
(detected ?p - human ?l - room)
(greeted ?r - robot ?p - human)
)
(:action detect
:parameters (?p - human ?i - item ?r - robot ?l - location)
:precondition (at ?r ?l)
:effect (and (at ?p ?l) (at ?r ?l))
)
(:action greet
:parameters (?r - robot ?p - human ?l - location)
:precondition (and (at ?r ?l) (detected ?p ?l))
:effect (greeted ?r ?p)
)
)
Problem File:
(define (problem test12)
(:domain sp)
(:objects person0 - Human
pepper0 - Robot
apple - Fruit
cup0 - Cup
table0 - Table
room0 - Room)
(:init
(at pepper0 room0)
)
(:goal (and
(detected person0 room0)
(greeted pepper0 person0)
)
)
)
我想要实现的是
- 机器人在房间里
- 当人进入房间时,机器人需要检测人
- 问候人类
- 它必须检测房间中的其他物体(如杯子、水果等)
当我运行这段代码时,我会出现以下错误。
solution-impossbible
ff: parsing domain file
domain 'SP' defined
... done.
ff: parsing problem file
problem 'TEST12' defined
... done.
ff: goal can be simplified to FALSE. No plan will solve it
我正确地遵循了语法,但它抛出了这个错误。我不知道该怎么做。谁能告诉我一个方向,如果可能的话,还有一些 PDDL
的调试资源?
输出本身不是错误。它只是表明您的问题没有计划。问题是 (detected ?p ?l)
永远不会被任何操作添加并且不处于您的初始状态,因此您永远无法实现它。您可能希望将其添加为 detect
操作的效果(而不是 (at ?r ?l)
?)。