Hope you all are doing well. I have a problem by solving PDDL domain and problem file. The task is as follows:
Two athletes A0;A1 and trainer T are preparing for a competition in the training setting shown in the figure. They start in P0 and they have to be all in P3 in order to finish a trial. Connections among places are highlighted by two paths: the athlete path (solid) and the trainer path (dotted). A0;A1 can only use the athlete path and they must jump over the first obstacle O0, and then crouch and pass underneath the second O1. T instead, can only walk the trainer path. Agents cannot move simultaneously, only one agent can move at each step from one place Pi to the next place in the path. Moreover, the trainer has to stay one or more steps ahead, to check the performance of the athletes, thus A0 and A1 must never anticipate T (i.e. they are allowed to be only in places already visited by T). Athletes and trainer can be all together in the same location of the training path. For example, if T is in P2 then A0;A1 can be in P0; P1 or P2. The athletes can take steps in arbitrary order (i.e. they can always agree on who makes the next step).
I have implemented both domain and problem files, but it doesn't work as expected in the statement. What am I doing wrong? Any help is appreciated.
The code:
1. Domain
;Header and description
(define (domain competition-domain)
(:requirements :strips )
(:predicates ;todo: define predicates here
(a1 ?x)(a2 ?x)(t ?x)(o ?x)(location ?x)(at ?x ?y))
;define actions here
(:action goto
:parameters (?athlete ?from ?to)
:precondition (and (a1 ?athlete)(a2 ?athlete)(location ?from)(location ?to)(at ?athlete ?from))
:effect (and(at ?athlete ?to)
(not(at ?athlete ?from))))
(:action jump
:parameters (?athlete ?obstacle ?from ?to)
:precondition (and (a1 ?athlete) (a2 ?athlete) (o ?obstacle)
(location ?from) (location ?to)
(at ?athlete ?from))
:effect (and(at ?athlete ?to)(not(at ?athlete ?from))))
(:action crouch
:parameters (?athlete ?obstacle ?from ?to)
:precondition (and (a1 ?athlete) (a2 ?athlete) (o ?obstacle)
(location ?from) (location ?to)
(at ?athlete ?from))
:effect (and(at ?athlete ?to)(not(at ?athlete ?from))))
)
2. Problem
(define (problem competition-problem) (:domain competition-domain)
(:objects A1 A2 T O0 O1 P0 P1 P2 P3
)
(:init
;todo: put the initial state's facts and numeric values here
(a1 A1) (a2 A2) (t T) (location P0) (location P1) (location P2) (location P3)
(at A1 P0) (at A2 P0) (at T P0)
)
(:goal (and
;todo: put the goal condition here
(at A1 P3) (at A2 P3) (at T P3)
))
)
Thus, my main problem here is to apply actions and statements for checking the obstacles.
Any kind of help is appreciated.