I am trying to add floor restrictions to my codes but it is not running in PDDL. Can someone help me find where I made mistakes?
Here is the PDDL domain:
(define (domain miconic)
(:requirements :adl :typing :strips)
(:types passenger - object
floor - count
elevator - object
elevator1 elevator2 elevator3 - elevator
)
(:predicates
(origin ?person - passenger ?floor - floor)
;; entry of ?lift ?person is ?floor
;; inertia
(destin ?person - passenger ?floor - floor)
;; exit of ?lift ?person is ?floor
;; inertia
(reachable-floor ?lift - elevator ?f - floor)
(above ?floor1 - floor ?floor2 - floor)
;; ?floor2 is located above of ?floor1
(boarded ?person - passenger ?lift - elevator)
;; true if ?person has boarded the lift
(served ?person - passenger ?lift - elevator)
;; true if ?person has alighted as her destination
(lift-at ?lift - elevator ?floor - floor)
;; current position of the ?lift is at ?floor
)
;;stop
(:action stop
:parameters (?lift - elevator ?f - floor)
:precondition (lift-at ?lift ?f)
:effect (and
(forall (?p - passenger)
(when (and (boarded ?p ?lift)
(destin ?p ?f))
(and (not (boarded ?p ?lift))
(served ?p ?lift))))
(forall (?p - passenger)
(when (and (origin ?p ?f) (not (served ?p ?lift)))
(boarded ?p ?lift)))))
)
;;drive up elevator1
(:action up-elevator1
:parameters (?lift - elevator1 ?f1 - floor ?f2 - floor)
:precondition (and (lift-at ?lift ?f1) (above ?f1 ?f2) (reachable-floor ?lift ?f2))
:effect (and (lift-at ?lift ?f2) (not (lift-at ?lift ?f1))
)
;;drive down elevator1
(:action down-elevator1
:parameters (?lift - elevator1 ?f1 - floor ?f2 - floor)
:precondition (and (lift-at ?lift ?f1) (above ?f2 ?f1) (reachable-floor ?lift ?f2))
:effect (and (lift-at ?lift ?f2) (not (lift-at ?lift ?f1))
)
;;drive up elevator2
(:action up-elevator2
:parameters (?lift - elevator2 ?f1 - floor ?f2 - floor)
:precondition (and (lift-at ?lift ?f1) (above ?f1 ?f2) (reachable-floor ?lift ?f2))
:effect (and (lift-at ?lift ?f2) (not (lift-at ?lift ?f1))))
;;drive down elevator2
(:action down-elevator2
:parameters (?lift - elevator2 ?f1 - floor ?f2 - floor)
:precondition (and (lift-at ?lift ?f1) (above ?f2 ?f1) (reachable-floor ?lift ?f2))
:effect (and (lift-at ?lift ?f2) (not (lift-at ?lift ?f1))))
;;drive up elevator3
(:action up-elevator3
:parameters (?lift - elevator3 ?f1 - floor ?f2 - floor)
:precondition (and (lift-at ?lift ?f1) (above ?f1 ?f2) (reachable-floor ?lift ?f2))
:effect (and (lift-at ?lift ?f2) (not (lift-at ?lift ?f1))))
;;drive down elevator3
(:action down-elevator3
:parameters (?lift - elevator3 ?f1 - floor ?f2 - floor)
:precondition (and (lift-at ?lift ?f1) (above ?f2 ?f1) (reachable-floor ?lift ?f2))
:effect (and (lift-at ?lift ?f2) (not (lift-at ?lift ?f1))))
Here is the PDDL problem:
(define (problem mixed-f2-p1-u0-v0-g0-a0-n0-A0-B0-N0-F0-r0)
(:domain miconic)
(:objects
p0 p1 p2 p3 p4 p5 p6 - passenger
f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 - floor
e1 - elevator1
e2 - elevator2
e3 - elevator3
)
(:init
(above f0 f1) (above f0 f2) (above f0 f3) (above f0 f4) (above f0 f5) (above f0 f6) (above f0 f7) (above f0 f8) (above f0 f9) (above f0 f10) (above f0 f11)
(above f1 f2) (above f1 f3) (above f1 f4) (above f1 f5) (above f1 f6) (above f1 f7) (above f1 f8) (above f1 f9) (above f1 f10) (above f1 f11)
(above f2 f3) (above f2 f4) (above f2 f5) (above f2 f6) (above f2 f7) (above f2 f8) (above f2 f9) (above f2 f10) (above f2 f11)
(above f3 f4) (above f3 f5) (above f3 f6) (above f3 f7) (above f3 f8) (above f3 f9) (above f3 f10) (above f3 f11)
(above f4 f5) (above f4 f6) (above f4 f7) (above f4 f8) (above f4 f9) (above f4 f10) (above f4 f11)
(above f5 f6) (above f5 f7) (above f5 f8) (above f5 f9) (above f5 f10) (above f5 f11)
(above f6 f7) (above f6 f8) (above f6 f9) (above f6 f10) (above f6 f11)
(above f7 f8) (above f7 f9) (above f7 f10) (above f7 f11)
(above f8 f9) (above f8 f10) (above f8 f11)
(above f9 f10) (above f9 f11)
(above f10 f11)
(origin p0 f4)
(destin p0 f5)
(origin p1 f3)
(destin p1 f0)
(origin p2 f6)
(destin p2 f7)
(origin p3 f6)
(destin p3 f1)
(origin p4 f7)
(destin p4 f3)
(origin p5 f8)
(destin p5 f11)
(origin p6 f11)
(destin p6 f5)
(lift-at e1 f0)
(reachable-floor e1 f1)(reachable-floor e1 f3)(reachable-floor e1 f5)(reachable-floor e1 f7)(reachable-floor e1 f9)(reachable-floor e1 f11)
(lift-at e2 f0)
(reachable-floor e2 f0)(reachable-floor e2 f2)(reachable-floor e2 f4)(reachable-floor e2 f6)(reachable-floor e2 f8)(reachable-floor e2 f10)
(lift-at e3 f0)
(reachable-floor e3 f3)(reachable-floor e3 f6)(reachable-floor e3 f9)
)
(:goal (forall (?lift - elevator ?p - passenger ?f - floor) (served ?p ?lift)))
)