Case of use
First of all, I want to explain my case of use: I want to divide a field in different sectors and all plants should be analyzed by robots (just one robot per sector). I want to check in :preconditions that all plants for one sector are already analyzed, so that the robot return to the 'home'.
Problem
Here is the domain PDDL. My problem is placed in the preconditions of "tracker-back-home" action. Now I am checking if all the plants have been already analyzed, but I need to know if all the plants of the specific sector ?s are analyzed. It is possible to do using forall statement?
(define (domain killbee)
(:requirements :strips :typing)
(:types
bee location - object
;Inheritance
tracker - bee
hive plant sector - location
)
(:predicates
(directly-connected ?l1 - location ?l2 - location)
(at ?l1 - object ?l2 - object) ;location is hive, plant or sector
(free-sector ?s - sector)
(bee-with-sector ?b - tracker)
(tracker-ready-to-move ?b - tracker)
(analyzed-plant ?p - plant ?s - sector)
(sector-tracked ?s - sector)
(plant-in-sector ?p - plant ?s - sector)
)
...
...
(:action tracker-back-home
:parameters (?b - tracker ?p - plant ?h - hive ?s - sector)
:precondition
(and (tracker-ready-to-move ?b)
(at ?b ?p)
(not (at ?b ?h))
(forall (?x - plant) (analyzed-plant ?x ?s)))
)
:effect
(and
(not (at ?b ?p))
(at ?b ?h)
(sector-tracked ?s)
(not (bee-with-sector ?b))
(free-sector ?s))
)...