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 TypeMethodDescriptionboolean
addAction(ParsedAction action)
Adds an action to the domain.boolean
addConstant(TypedSymbol<String> constant)
Adds a constant to the domain.boolean
addDerivedPredicate(ParsedDerivedPredicate predicate)
Adds a derived predicate to the domain.boolean
addFunction(NamedTypedList function)
Adds a function to the domain.boolean
addMethod(ParsedMethod method)
Adds a method to the domain.boolean
addPredicate(NamedTypedList predicate)
Adds a predicate to the domain.boolean
addRequirement(RequireKey requirement)
Adds a requirements to the domain.boolean
addTask(NamedTypedList task)
Adds a task to the domain.boolean
addType(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.boolean
isDeclaredConstant(Symbol<String> constant)
Returns if a specified constant symbol was declared.boolean
isDeclaredType(Symbol<String> type)
Returns if a specified type symbol was declared.boolean
isSubType(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.void
Normalize the domain.void
setConstraints(Expression<String> constraints)
Sets the constraints to the domain.void
setDomainName(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:
true
if the requirement was added;false
otherwise.
-
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:
true
if the type was added;false
otherwise.
-
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:
true
if the constant was added;false
otherwise.
-
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:
true
if the predicate was added;false
otherwise.- 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:
true
if the function was added;false
otherwise.
-
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:
true
if the task was added;false
otherwise.
-
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:
true
if the action was added;false
otherwise.
-
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:
true
if the method was added;false
otherwise.
-
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:
true
if the derived predicate was added;false
otherwise.- Throws:
NullPointerException
- if the specified predicate is null.
-
isDeclaredType
Returns if a specified type symbol was declared.- Parameters:
type
- the type symbol.- Returns:
true
if the specified symbol is a declared type;false
otherwise.
-
getType
Returns the type from a specified symbol.- Parameters:
symbol
- The symbol.- Returns:
- the type from a specified symbol or
null
if no type with this symbol was declared.
-
isDeclaredConstant
Returns if a specified constant symbol was declared.- Parameters:
constant
- the constant symbol.- Returns:
true
if the specified symbol is a declared constant;false
otherwise.
-
getConstant
Returns the constant from a specified symbol.- Parameters:
symbol
- The symbol.- Returns:
- the constant from a specified symbol or
null
if 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:
true
if the types of the first typed symbol can be viewed as a subtype of the seconds.false
otherwise.
-
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.
-