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
ConstructorsModifierConstructorDescriptionprotectedCreates a new empty search.protectedAbstractPlan(Plan other)Creates a new search from an other one. -
Method Summary
Modifier and TypeMethodDescriptiondoublecost()Returns the cost of the search.Returns the hierarchy of this plan.booleanisEmpty()Returns if the search is empty.booleanReturns if this plan is hierarchical.voidsetHierarchy(Hierarchy hierarchy)Sets the hierarchy of this plan.intsize()Returns the size of the search.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
isEmptyin interfacePlan- Returns:
trueif the search is empty;falseotherwise.- See Also:
Plan.isEmpty()
-
isHierarchical
public final boolean isHierarchical()Returns if this plan is hierarchical.- Specified by:
isHierarchicalin interfacePlan- Returns:
trueif this plan is hierarchical;falseotherwise.
-
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:
getHierarchyin 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:
setHierarchyin interfacePlan- Parameters:
hierarchy- the hierarchical decomposition of this plan.- See Also:
Plan.isHierarchical()
-