Package fr.uga.pddl4j.problem
Class AbstractProblem
java.lang.Object
fr.uga.pddl4j.problem.AbstractProblem
- All Implemented Interfaces:
AtomicFormulaSimplifier<Integer>
,Problem
,Serializable
- Direct Known Subclasses:
PreInstantiatedProblem
This class contains all the methods needed to encode a planning problem into int representation before
instantiation.
- See Also:
- Serialized Form
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
The enum used to list the set of internal data structures needed by the instantiation process. -
Constructor Summary
ConstructorDescriptionAbstractProblem(DefaultParsedProblem problem)
Creates a new problem from a domain and problem. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
This methods finalize the domain, i.e., it encodes the planning problem into it final compact representation using bit set.Returns the list of compound tasks symbols of the problem.Returns the list of constant symbols of the problem.Returns the domains for each type of the problem.Returns the list of function symbols of the problem.Returns the signatures of the functions defined in the problem.Returns the list of actions under its integer representation of the problem.protected Expression<Integer>
Returns the goal of the problem as anExpression
.protected Map<Expression<Integer>,Double>
Returns the map that store the value of the numeric fluents in the form ofExpression
of the initial state.protected Set<Expression<Integer>>
Returns the list of numeric fluents in the form ofExpression
of the initial state.protected Set<Expression<Integer>>
Returns the list of fluent in the form ofExpression
of the initial state.protected IntTaskNetwork
Returns the initial task network into its integer representation.Returns the list of methods of the problem into its integer representation.protected Set<Expression<Integer>>
Returns the list of timed fluent in the form ofExpression
of the initial state.Returns the parsed problem used to create this problem.Returns the signatures of the predicates defined in the problem.Returns the list of predicate symbols of the problem.Returns the list of primitive task symbols of the problem.Returns the requirements of the problem.Returns the signatures of the task defined in the problem.Returns the list of task symbols of the problem.getTypes()
Returns the list of the type symbols of the problem.protected void
Encodes the actions of the domain into a compact integer representation.protected void
Initializes the compound task symbols from the methods of the domain.protected void
Initializes the constants declared in the domain and the problem and initialise the domains of values of each type.protected void
Initializes the composite type, i.e., type of the form (either t1 t2), through a specified domain and problem and creates their respective domain.protected Expression<Integer>
initExpression(Expression<String> exp, List<String> variables)
Encodes an specified expression into its integer representation.protected void
Initializes the function information (symbols and signatures) declared in the domain.protected void
initGoal()
Encodes a specified goal into its integer representation.protected abstract void
This methods initializes the structures needed to the instantiation process from the PDDL domain and problem given in parameters of the constructor of the class.protected void
Encodes a specified initial state into its integer representation.protected void
Encodes a specified task network into its integer representation.protected void
Encodes the methods of the domain into a compact integer representation.protected void
Initializes the predicate information (symbols and signatures) declared in the domain.protected void
Initializes the primitive task symbols from the actions of the domain.protected void
Init the list of requirement of the problem.protected IntTaskNetwork
initTaskNetwork(ParsedTaskNetwork parsedTaskNetwork, List<String> parameters, List<Integer> types)
Encodes a specified task network into its integer representation.protected void
Initializes the tasks information (symbols and signatures) declared in the domain.protected void
Initializes the list of type symbols form the list declared in the domain.void
Instantiates the problem.protected abstract void
This methods carries out the instantiation of the planning operators and the goal of the problem in to actions.protected abstract void
This method carries out all the necessary treatment to postinstantiate the problem.protected abstract void
This method carries out all the necessary treatment to preinstantiate the problem.protected void
setIntInitialTaskNetwork(IntTaskNetwork taskNetwork)
Sets the integer initial task network of thi problem.toShortString(AbstractInstantiatedOperator operator, List<String> constants)
Returns a short string representation of the specified operator, i.e., its name and its instantiated parameters.protected String
toString(Expression<Integer> exp)
Returns a string representation of an expression.protected String
toString(Expression<Integer> exp, String separator)
Returns a string representation of an expression.protected String
toString(Expression<Integer> exp, String baseOffset, String separator)
Returns a string representation of an expression.protected String
toString(AbstractProblem.Data data)
Returns a string representation of the internal data structure used during instantiation process.protected String
toString(AbstractIntOperator operator)
Returns a string representation of the specified operator.protected String
Returns a string representation of the specified action.protected String
Returns a string representation of the specified method.toString(IntTaskNetwork taskNetwork)
Returns a string representation of the specified task network.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface fr.uga.pddl4j.problem.Problem
getAcceptedRequirements, getActions, getDurativeActions, getDurativeMethods, getFluents, getGoal, getInitialState, getInitialTaskNetwork, getMethods, getTaskResolvers, getTasks, isSolvable, isTotallyOrdered, simplify, toShortString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString, toString
-
Constructor Details
-
AbstractProblem
Creates a new problem from a domain and problem.- Parameters:
problem
- the problem.
-
-
Method Details
-
getParsedProblem
Returns the parsed problem used to create this problem.- Specified by:
getParsedProblem
in interfaceProblem
- Returns:
- the parsed problem used to create this problem.
-
getRequirements
Returns the requirements of the problem.- Specified by:
getRequirements
in interfaceProblem
- Returns:
- the requirements of the problem.
-
getTypes
Returns the list of the type symbols of the problem. -
getDomains
Returns the domains for each type of the problem.- Specified by:
getDomains
in interfaceProblem
- Returns:
- the domains for each type of the problem.
-
getConstantSymbols
Returns the list of constant symbols of the problem.- Specified by:
getConstantSymbols
in interfaceProblem
- Returns:
- the list of constant symbols of the problem.
-
getPredicateSymbols
Returns the list of predicate symbols of the problem.- Specified by:
getPredicateSymbols
in interfaceProblem
- Returns:
- the list predicate symbols of the problem.
-
getPredicateSignatures
Returns the signatures of the predicates defined in the problem.- Specified by:
getPredicateSignatures
in interfaceProblem
- Returns:
- the signatures of the predicates defined in the problem.
-
getTaskSymbols
Returns the list of task symbols of the problem.- Returns:
- the list of task symbols of the problem.
-
getTaskSignatures
Returns the signatures of the task defined in the problem.- Returns:
- the signatures of the task defined in the problem.
-
getFunctions
Returns the list of function symbols of the problem.- Returns:
- the list of function symbols of the problem.
-
getFunctionSignatures
Returns the signatures of the functions defined in the problem.- Returns:
- the signatures of the functions defined in the problem.
-
getPrimitiveTaskSymbols
Returns the list of primitive task symbols of the problem.- Returns:
- the list of primitive task symbols of the problem.
-
getCompoundTaskSymbols
Returns the list of compound tasks symbols of the problem.- Returns:
- the list of compound tasks symbols of the problem.
-
instantiate
public final void instantiate()Instantiates the problem. This method calls in this order the methods initialization(), preinstantiation(), instantiation(), postinstantiation() and finalization(). This methods must be override in each concrete classe.- Specified by:
instantiate
in interfaceProblem
-
initialization
protected abstract void initialization()This methods initializes the structures needed to the instantiation process from the PDDL domain and problem given in parameters of the constructor of the class. First, it collects the constants, the types, the predicate, the function and the tasks symbols. Then, it encodes the actions, the methods, the goal and the initial tasks network of the problem into compact int representation. -
preinstantiation
protected abstract void preinstantiation()This method carries out all the necessary treatment to preinstantiate the problem. In particular, it calculates the static properties (Inertia) of the problem in order to prune as soon as possible the actions that can never be triggered. -
instantiation
protected abstract void instantiation()This methods carries out the instantiation of the planning operators and the goal of the problem in to actions. -
postinstantiation
protected abstract void postinstantiation()This method carries out all the necessary treatment to postinstantiate the problem. In particular, it simplifies the actions instantiated based on static properties based on the initial state information of the problem in order to prune the actions that can never be triggered. -
finalization
protected abstract void finalization()This methods finalize the domain, i.e., it encodes the planning problem into it final compact representation using bit set. -
initRequirements
Init the list of requirement of the problem.- Throws:
RequirementNotSupportedException
- if the requirements of the domain and the problem are not supported.
-
initTypes
protected void initTypes()Initializes the list of type symbols form the list declared in the domain. The corresponding domain of values of the type is created. The domain is empty. -
initConstants
protected void initConstants()Initializes the constants declared in the domain and the problem and initialise the domains of values of each type. -
initEitherTypes
protected void initEitherTypes()Initializes the composite type, i.e., type of the form (either t1 t2), through a specified domain and problem and creates their respective domain. Warning: constants must be collected before using this method. It is necessary to correctly initialized the domain of the either types collected. -
initPredicates
protected void initPredicates()Initializes the predicate information (symbols and signatures) declared in the domain. -
initFunctions
protected void initFunctions()Initializes the function information (symbols and signatures) declared in the domain. -
initTasks
protected void initTasks()Initializes the tasks information (symbols and signatures) declared in the domain. -
initPrimitiveTaskSymbols
protected void initPrimitiveTaskSymbols()Initializes the primitive task symbols from the actions of the domain. -
initCompoundTaskSymbols
protected void initCompoundTaskSymbols()Initializes the compound task symbols from the methods of the domain. -
getIntActions
Returns the list of actions under its integer representation of the problem.- Returns:
- the list of actions under its integer representation of the problem.
- See Also:
IntAction
-
getIntInitialState
Returns the list of fluent in the form ofExpression
of the initial state.- Returns:
- the list of fluent in the form of
Expression
of the initial state. - See Also:
Expression
-
getIntTimedFluents
Returns the list of timed fluent in the form ofExpression
of the initial state.- Returns:
- the list of timed fluent in the form of
Expression
of the initial state. - See Also:
Expression
-
getIntInitFunctionCost
Returns the map that store the value of the numeric fluents in the form ofExpression
of the initial state.- Returns:
- the map that store the value of the numeric fluents in the form of
Expression
of the initial state. - See Also:
Expression
-
getIntGoal
Returns the goal of the problem as anExpression
.- Returns:
- the goal of the problem as an
Expression
. - See Also:
Expression
-
getIntInitFunctions
Returns the list of numeric fluents in the form ofExpression
of the initial state.- Returns:
- the list of numeric fluents in the form of
Expression
of the initial state. - See Also:
Expression
-
getIntMethods
Returns the list of methods of the problem into its integer representation.- Returns:
- the list of methods of the problem into its integer representation.
-
getIntInitialTaskNetwork
Returns the initial task network into its integer representation.- Returns:
- the initial task network into its integer representation.
-
setIntInitialTaskNetwork
Sets the integer initial task network of thi problem.- Parameters:
taskNetwork
- the task network to set.
-
initInitialState
protected void initInitialState()Encodes a specified initial state into its integer representation. -
initGoal
protected void initGoal()Encodes a specified goal into its integer representation. -
initActions
protected void initActions()Encodes the actions of the domain into a compact integer representation. -
initMethods
protected void initMethods()Encodes the methods of the domain into a compact integer representation. -
initInitialTaskNetwork
protected void initInitialTaskNetwork()Encodes a specified task network into its integer representation. -
initTaskNetwork
protected IntTaskNetwork initTaskNetwork(ParsedTaskNetwork parsedTaskNetwork, List<String> parameters, List<Integer> types)Encodes a specified task network into its integer representation.- Parameters:
parsedTaskNetwork
- the parsed task network.parameters
- the parameters of the task network.types
- the type of parameters.- Returns:
- the a integer representation of the task network in parameter.
-
initExpression
Encodes an specified expression into its integer representation.Notes:
- equal predicate used specified value of -1.
- variables used negative values in [-1,-infinity[.
- Parameters:
exp
- the expression to encode.variables
- the list of variable already encoded.- Returns:
- the integer representation of the specified expression.
-
toString
Returns a string representation of the specified action.- Parameters:
action
- the operator to print.- Returns:
- a string representation of the specified operator.
-
toString
Returns a string representation of the specified method.- Parameters:
method
- the method to print.- Returns:
- a string representation of the specified method.
-
toString
Returns a string representation of the specified operator.- Parameters:
operator
- the operator.- Returns:
- a string representation of the specified operator.
-
toString
Returns a string representation of the specified task network.- Parameters:
taskNetwork
- the task network to print.- Returns:
- a string representation of the specified method.
-
toString
Returns a string representation of an expression.- Parameters:
exp
- the expression.- Returns:
- a string representation of the specified expression.
-
toString
Returns a string representation of an expression.- Parameters:
exp
- the expression.separator
- the string separator between predicate symbol and arguments.- Returns:
- a string representation of the specified expression.
-
toString
Returns a string representation of an expression.- Parameters:
exp
- the expression.baseOffset
- the offset white space from the left used for indentation.separator
- the string separator between predicate symbol and arguments.- Returns:
- a string representation of the specified expression node.
-
toString
Returns a string representation of the internal data structure used during instantiation process.- Parameters:
data
- the internal data structure.- Returns:
- a string representation of the internal data structure used during instantiation process.
-
toShortString
Returns a short string representation of the specified operator, i.e., its name and its instantiated parameters.- Parameters:
operator
- the operator.constants
- the table of constants.- Returns:
- a string representation of the specified operator.
-