Package fr.uga.pddl4j.plan
Class AbstractPlan
java.lang.Object
fr.uga.pddl4j.plan.AbstractPlan
- All Implemented Interfaces:
Plan
,Serializable
- Direct Known Subclasses:
ParallelPlan
,SequentialPlan
,TemporalPlan
This abstract class implements the main methods of a search.
- Since:
- 3.0
- See Also:
- Serialized Form
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a new empty search.protected
AbstractPlan(Plan other)
Creates a new search from an other one. -
Method Summary
Modifier and TypeMethodDescriptiondouble
cost()
Returns the cost of the search.Returns the hierarchy of this plan.boolean
isEmpty()
Returns if the search is empty.boolean
Returns if this plan is hierarchical.void
setHierarchy(Hierarchy hierarchy)
Sets the hierarchy of this plan.int
size()
Returns the size of the search.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.plan.Plan
actions, add, clear, contains, getActionSet, makespan, remove, remove, timeSpecifiers
-
Constructor Details
-
AbstractPlan
protected AbstractPlan()Creates a new empty search. The plan created is noy hierarchical. -
AbstractPlan
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. -
cost
public double cost()Returns the cost of the search. The cost of a search is the sum of the cost of its actions. -
isEmpty
public final boolean isEmpty()Returns if the search is empty.- Specified by:
isEmpty
in interfacePlan
- 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 interfacePlan
- Returns:
true
if this plan is hierarchical;false
otherwise.
-
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 interfacePlan
- Returns:
- the hierarchical decomposition of this plan or null is this plan is not hierarchical.
- See Also:
Plan.isHierarchical()
-
setHierarchy
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 interfacePlan
- Parameters:
hierarchy
- the hierarchical decomposition of this plan.- See Also:
Plan.isHierarchical()
-