这是一个非常域文件,可将潜艇从一个位置移动到另一个位置:
(define (domain unnamed1)
(:requirements
:strips :typing)
(:types
location; check if at command-centre, shallow water, deep water, land
personnel; human occupation
sub; vehicle
)
(:predicates
(sub_at ?s - sub ?loc - location); check if sub is at a specific location
(is_pilot ?p - personnel)
(deep_water ?loc - location)
(shallow_water ?loc - location)
(land ?loc - location)
(adjacent-to ?t1 - location ?t2 - location);
)
(:action move
:parameters
(?s - sub ?from - location ?to - location ?p - personnel ?c - capacity)
:precondition
(and
(sub_at ?s ?from); check where the subs starting location is
(or ;check if 'starting location' is adjacent to destination
(adjacent-to ?to ?from)
(adjacent-to ?from ?to)
);
(or; Check if in water
(shallow_water ?to)
(deep_water ?to)
)
(is_pilot ?p); check if member is a pilot
)
:effect
(and
(sub_at ?s ?to); sub is now at destination
(not (sub_at ?s ?from)); Sub is no longer at starting point
)
)
)
上述域文件遵循三个非常简单的要求:
潜艇可以移动的位置必须与潜艇相邻 潜艇已经所在的位置。例如:如果潜艇位于 位置 X 并想要移动到 Y,Y 必须与 X 相邻。
要移动的位置必须位于深/浅水中,并且,
船上必须有飞行员。
这是一个将潜艇从指挥中心移动到第一个位置的问题文件。这有效。
(define (problem underwater_problem)
(:domain unnamed1)
(:objects
command-centre - location
loc1 - location
loc2 - location
persPilot - personnel
subm - sub
)
(:init
(sub_at subm command-centre)
(adjacent-to command-centre loc1)
(adjacent-to loc1 loc2)
(shallow_water loc1)
(deep_water loc2)
(is_pilot persPilot)
)
(:goal
(sub_at subm loc1)
)
)
问题就在这里。我希望潜艇能够跨越许多不同的位置:
(define (problem underwater_problem)
(:domain unnamed1)
(:objects
command-centre - location
loc1 - location
loc2 - location
persPilot - personnel
subm - sub
)
(:init
(sub_at subm command-centre)
(adjacent-to command-centre loc1)
(adjacent-to loc1 loc2)
(shallow_water loc1)
(deep_water loc2)
(is_pilot persPilot)
)
(:goal
(and
(sub_at subm loc1)
(sub_at subm loc2)
)
)
)
不幸的是,返回以下错误:
Suspected timeout.
--- OK.
Match tree built with 3 nodes.
PDDL problem description loaded:
Domain: UNNAMED1
Problem: UNDERWATER_PROBLEM
#Actions: 3
#Fluents: 3
Landmarks found: 2
Starting search with IW (time budget is 60 secs)...
rel_plan size: 2
#RP_fluents 2
Caption
{#goals, #UNnachieved, #Achieved} -> IW(max_w)
{2/1/0}:IW(1) -> [2][3][4];; NOT I-REACHABLE ;;
Total time: 2.5e-05
Nodes generated during search: 4
Nodes expanded during search: 4
IW search completed
Starting search with BFS(novel,land,h_add)...
--[4294967295 / 3]--
--[3 / 3]--
--[3 / 1]--
--[2 / 1]--
--[1 / 1]--
Total time: 1.2e-05
Nodes generated during search: 4
Nodes expanded during search: 3
Plan found with cost: 2.8026e-45
BFS search completed
我不知道这意味着什么。
你的目标要求计划者将潜艇同时带到两个地方:
(:goal
(and
(sub_at subm loc1)
(sub_at subm loc2)
)
)
如果删除
(sub_at subm loc1)
,它应该可以工作。