Package fr.uga.pddl4j.parser
Interface ParsedDomain
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
DefaultParsedProblem
This interface defined the methods of a planning domain read by the parser.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAction(ParsedAction action)Adds an action to the domain.booleanaddConstant(TypedSymbol<String> constant)Adds a constant to the domain.booleanaddDerivedPredicate(ParsedDerivedPredicate predicate)Adds a derived predicate to the domain.booleanaddFunction(NamedTypedList function)Adds a function to the domain.booleanaddMethod(ParsedMethod method)Adds a method to the domain.booleanaddPredicate(NamedTypedList predicate)Adds a predicate to the domain.booleanaddRequirement(RequireKey requirement)Adds a requirements to the domain.booleanaddTask(NamedTypedList task)Adds a task to the domain.booleanaddType(TypedSymbol<String> type)Adds a type to the domain.Returns the list of parsed ops.getConstant(Symbol<String> symbol)Returns the constant from a specified symbol.Returns the parsed constants in the domain file.Returns the constraints loaded in the domain file.Returns the list of parsed derived predicates.Returns the name of the domain.Returns the parsed functions in the domain file.Returns the list of parsed methods.Returns the parsed predicates in the domain file.Returns the set of requirements.getTasks()Returns the parsed tasks un the domain file.Returns the type from a specified symbol.getTypes()Returns the parsed types in the domain file.booleanisDeclaredConstant(Symbol<String> constant)Returns if a specified constant symbol was declared.booleanisDeclaredType(Symbol<String> type)Returns if a specified type symbol was declared.booleanisSubType(TypedSymbol<String> s1, TypedSymbol<String> s2)Returns if the types of two typed symbol matched, i.e., if the types of the first typed symbol can be viewed as a subtype of the second.voidNormalize the domain.voidsetConstraints(Expression<String> constraints)Sets the constraints to the domain.voidsetDomainName(Symbol<String> name)Sets a name to the domain.toString()Returns a string representation of this domain.
-
Method Details
-
getDomainName
Returns the name of the domain.- Returns:
- the name of the domain.
-
setDomainName
Sets a name to the domain.- Parameters:
name- the name to set.
-
getRequirements
Set<RequireKey> getRequirements()Returns the set of requirements.- Returns:
- the set of requirements.
-
addRequirement
Adds a requirements to the domain.- Parameters:
requirement- the requirement to add.- Returns:
trueif the requirement was added;falseotherwise.
-
getTypes
List<TypedSymbol<String>> getTypes()Returns the parsed types in the domain file.- Returns:
- the parsed types in the domain file.
-
addType
Adds a type to the domain.- Parameters:
type- the type to add.- Returns:
trueif the type was added;falseotherwise.
-
getConstants
List<TypedSymbol<String>> getConstants()Returns the parsed constants in the domain file.- Returns:
- the parsed constants in the domain file.
-
addConstant
Adds a constant to the domain.- Parameters:
constant- the constant to add.- Returns:
trueif the constant was added;falseotherwise.
-
getPredicates
List<NamedTypedList> getPredicates()Returns the parsed predicates in the domain file.- Returns:
- the parsed predicates in the domain file.
-
addPredicate
Adds a predicate to the domain.- Parameters:
predicate- the predicate to add.- Returns:
trueif the predicate was added;falseotherwise.- Throws:
NullPointerException- if the specified predicate is null.
-
getFunctions
List<NamedTypedList> getFunctions()Returns the parsed functions in the domain file.- Returns:
- the parsed functions in the domain file.
-
addFunction
Adds a function to the domain.- Parameters:
function- the function to add.- Returns:
trueif the function was added;falseotherwise.
-
getTasks
List<NamedTypedList> getTasks()Returns the parsed tasks un the domain file.- Returns:
- the parsed tasks in the domain file.
-
addTask
Adds a task to the domain.- Parameters:
task- the task to add.- Returns:
trueif the task was added;falseotherwise.
-
getConstraints
Expression<String> getConstraints()Returns the constraints loaded in the domain file.- Returns:
- the constraints loaded in the domain file or null if the domain has no constraints.
-
setConstraints
Sets the constraints to the domain.- Parameters:
constraints- the constraint of the domain.
-
getActions
List<ParsedAction> getActions()Returns the list of parsed ops.- Returns:
- the list of parsed ops.
-
addAction
Adds an action to the domain.- Parameters:
action- the action to add.- Returns:
trueif the action was added;falseotherwise.
-
getMethods
List<ParsedMethod> getMethods()Returns the list of parsed methods.- Returns:
- the list of parsed methods.
-
addMethod
Adds a method to the domain.- Parameters:
method- the method to add.- Returns:
trueif the method was added;falseotherwise.
-
getDerivesPredicates
List<ParsedDerivedPredicate> getDerivesPredicates()Returns the list of parsed derived predicates.- Returns:
- the list of parsed derived predicates.
-
addDerivedPredicate
Adds a derived predicate to the domain.- Parameters:
predicate- the derived predicate to add.- Returns:
trueif the derived predicate was added;falseotherwise.- Throws:
NullPointerException- if the specified predicate is null.
-
isDeclaredType
Returns if a specified type symbol was declared.- Parameters:
type- the type symbol.- Returns:
trueif the specified symbol is a declared type;falseotherwise.
-
getType
Returns the type from a specified symbol.- Parameters:
symbol- The symbol.- Returns:
- the type from a specified symbol or
nullif no type with this symbol was declared.
-
isDeclaredConstant
Returns if a specified constant symbol was declared.- Parameters:
constant- the constant symbol.- Returns:
trueif the specified symbol is a declared constant;falseotherwise.
-
getConstant
Returns the constant from a specified symbol.- Parameters:
symbol- The symbol.- Returns:
- the constant from a specified symbol or
nullif no constant with this symbol was declared.
-
isSubType
Returns if the types of two typed symbol matched, i.e., if the types of the first typed symbol can be viewed as a subtype of the second.- Parameters:
s1- the first typed symbol.s2- the second typed symbol.- Returns:
trueif the types of the first typed symbol can be viewed as a subtype of the seconds.falseotherwise.
-
normalize
void normalize()Normalize the domain. This method rename the variables used in the domain and normalize its ops and derived predicates. -
toString
String toString()Returns a string representation of this domain.
-