PDDL predicate variable with multiple types

I am trying to write a PDDL domain. I have 4 types. My issues is that when specifiying one of the predicates:

At(?x - type ?l - location)

I want x to be able to take on three of the types, but it only allows me to do one. What should I do?

Upvotes: 0

Views: 1463

Answers (2)

Victor Paléologue
Victor Paléologue

Reputation: 2352

The syntax of PDDL expects your predicate declaration to look as follows:

(at ?x - entity ?l - location)

Check closely the use of parentheses.

Otherwise, you are doing it right. By expecting an entity that is a supertype of agent, object and robot, you will accept any of these subtypes.

However note that in many planners, the type object is already implicitly defined as the root type. I recommend you rename it into physical_object.

Upvotes: 0

Okay so essentially what I did was I created a type called entity and then specififed that my robot, agent and object types are entities:

        (:types
    entity
    agent - entity
    object - entity
    robot - entity
    location
    )

(:predicates
At(?x - entity, ?l - location)
)

Upvotes: -1

Related Questions