Class AbstractPlan

java.lang.Object
fr.uga.pddl4j.plan.AbstractPlan
All Implemented Interfaces:
Plan, Serializable
Direct Known Subclasses:
ParallelPlan, SequentialPlan, TemporalPlan

public abstract class AbstractPlan extends Object implements Plan
This abstract class implements the main methods of a search.
Since:
3.0
See Also:
Serialized Form
  • Constructor Details

    • AbstractPlan

      protected AbstractPlan()
      Creates a new empty search. The plan created is noy hierarchical.
    • AbstractPlan

      protected AbstractPlan(Plan other)
      Creates a new search from an other one. The new search is a deep copy of the specified search in parameter.
      Parameters:
      other - the plan on which a deep copy is done.
  • Method Details

    • size

      public final int size()
      Returns the size of the search. The size of the search is its number of actions.
      Specified by:
      size in interface Plan
      Returns:
      the size of the search.
    • cost

      public double cost()
      Returns the cost of the search. The cost of a search is the sum of the cost of its actions.
      Specified by:
      cost in interface Plan
      Returns:
      the cost of the search.
    • isEmpty

      public final boolean isEmpty()
      Returns if the search is empty.
      Specified by:
      isEmpty in interface Plan
      Returns:
      true if the search is empty; false otherwise.
      See Also:
      Plan.isEmpty()
    • isHierarchical

      public final boolean isHierarchical()
      Returns if this plan is hierarchical.
      Specified by:
      isHierarchical in interface Plan
      Returns:
      true if this plan is hierarchical; false otherwise.
    • getHierarchy

      public final Hierarchy getHierarchy()
      Returns the hierarchy of this plan. The hierarchy is additional information produced by HTN planners to specified the hierarchical decomposition of the initial task networks into primitive tasks applied to produce a plan.
      Specified by:
      getHierarchy in interface Plan
      Returns:
      the hierarchical decomposition of this plan or null is this plan is not hierarchical.
      See Also:
      Plan.isHierarchical()
    • setHierarchy

      public final void setHierarchy(Hierarchy hierarchy)
      Sets the hierarchy of this plan. The hierarchy is additional information produced by HTN planners to specified the hierarchical decomposition of the initial task networks into primitive tasks applied to produce a plan.
      Specified by:
      setHierarchy in interface Plan
      Parameters:
      hierarchy - the hierarchical decomposition of this plan.
      See Also:
      Plan.isHierarchical()