Class PreInstantiatedProblem

java.lang.Object
fr.uga.pddl4j.problem.AbstractProblem
fr.uga.pddl4j.problem.PreInstantiatedProblem
All Implemented Interfaces:
AtomicFormulaSimplifier<Integer>, Problem, Serializable
Direct Known Subclasses:
InstantiatedProblem

public abstract class PreInstantiatedProblem extends AbstractProblem
This class contains all the methods needed to the pre-treatments carried out before the instantiation of a problem: type inference for non-typed domains and inertia extraction to speed up the instantiation process.
See Also:
Serialized Form
  • Constructor Details

    • PreInstantiatedProblem

      public PreInstantiatedProblem(DefaultParsedProblem problem)
      Creates a new problem from a specific domain and problem.
      Parameters:
      problem - the problem.
  • Method Details

    • getInertia

      protected List<Inertia> getInertia()
      Returns the list of inertia contained in the problem.
      Returns:
      the list of inertia contained in the problem.
    • getNumericInertia

      protected List<Inertia> getNumericInertia()
      Returns the list of numeric inertia contained in the problem.
      Returns:
      the list of numeric inertia contained in the problem.
    • extractInertia

      protected void extractInertia()
      This method proceeds over the actions of the domain and checks for all atom which kind of inertia it is. For each atom it checks if it satisfies one of the following definitions:

      Definition: A relation is a positive inertia iff it does not occur positively in an unconditional effect or the consequent of a conditional effect of an action.

      Definition: A relation is a negative inertia iff it does not occur negatively in an unconditional effect or the consequent of a conditional effect of an action.

      Relations, which are positive as well as negative inertia, are simply called inertia. Relations, which are neither positive nor negative inertia, are called fluents. The detection of inertia and fluents is easy because in ADL, effects are restricted to conjunctions of literals. Furthermore, this information can be obtained with a single pass over the domain description, which takes almost no time at all.

      Note: before calling this method the domain must be encode into integer and the negation must be move inward the expression.

    • extractNumericInertia

      protected void extractNumericInertia()
      Extract the numeric inertia from the list of actions. A numeric fluent is a inertia iff it never appears in the effect of an action.
    • inferTypesFromInertia

      protected void inferTypesFromInertia()
      Infer type from unary inertia contained in the initial state.
    • simplifyActionsWithInferredTypes

      protected void simplifyActionsWithInferredTypes()
      AtomicFormulaSimplifier the actions with the inferred types.
    • createPredicatesTables

      protected void createPredicatesTables()
      This method creates the predicate tables used to simplify atomic expression.
    • printPredicatesTables

      protected void printPredicatesTables(List<List<IntMatrix>> tables)
      Print the predicates tables.
      Parameters:
      tables - predicates tables.
    • simplify

      public boolean simplify(Expression<Integer> exp)
      This method simplifies an atomic specified expression. Two cased must be considered:
      • 1. If the expression is a positive inertia and the number of unifying ground instances of the specified expression that are contained in the initial state is equal to 0 then the expression is simplified to FALSE.
      • 2. If the expression is a negative inertia and then the number of all possible type-consistent ground instances of the specified expression then the expression is simplified to TRUE.
      Parameters:
      exp - the atomic expression to simplify.
      Returns:
      if the atomic expression was simply or not.
    • toString

      protected String toString(AbstractProblem.Data data)
      Returns a string representation of the internal data structure used during instantiation process.
      Overrides:
      toString in class AbstractProblem
      Parameters:
      data - the internal data structure.
      Returns:
      a string representation of the internal data structure used during instantiation process.