下面是用 pddl 编写的过河问题的一小部分。我试图在两个不同的工具(editor.planning.domains 和 stripsfiddle.herokuapp.com)中找到解决方案,但它们都给出了相同的结果。
;domain;
(define (domain RiverCrossing)
(:requirements :strips :typing)
(:types
Farmer Fox - passengers
)
(:predicates
(onLeftBank ?p - passengers)
(onRightBank ?p - passengers)
)
(:action crossRiverLR
:parameters (?f - Farmer)
:precondition ( and (onLeftBank ?f))
:effect( and (onRightBank ?f) )
)
(:action crossRiverRL
:parameters (?f - Farmer)
:precondition ( and (onRightBank ?f))
:effect( and (onLeftBank ?f) )
)
(:action crossRiverLRf
:parameters ( ?fx - Fox ?f - Farmer)
:precondition ( and (onLeftBank ?f) (onLeftBank ?fx) )
:effect( and (onRightBank ?fx) (onRightBank ?f) )
)
(:action crossRiverRLf
:parameters (?f - Farmer ?fx - Fox)
:precondition ( and (onRightBank ?f) (onRightBank ?fx) )
:effect( and (onLeftBank ?f) (onLeftBank ?fx) )
)
)
问题
(define (problem RCP)
(:domain RiverCrossing)
(:objects
farmer - Farmer
fox - Fox
)
(:init
(onRightBank farmer) (onLeftBank fox)
)
(:goal
(and
(onLeftBank farmer) (onRightBank fox)
)
)
)
两个编译器都给出相同的结果;农夫不去左岸:
Solution found in 2 steps!
1. crossRiverRL farmer
2. crossRiverLRf fox farmer
谁能帮我弄清楚我遗漏的地方?提前致谢,