Package fr.uga.pddl4j.plan
Class ParallelPlan
java.lang.Object
fr.uga.pddl4j.plan.AbstractPlan
fr.uga.pddl4j.plan.ParallelPlan
- All Implemented Interfaces:
Plan,Serializable
This class implements a parallel plan based on the Graphplan planner semantic. A parallel plan in the Graphplan
planner semantic is a sequence of sets of actionSets. Each action contained in a set are considered as unordered.
- Since:
- 3.0
- See Also:
- Serialized Form
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty parallel plan.ParallelPlan(Plan other)Creates a new parallel plan from an other. -
Method Summary
Modifier and TypeMethodDescriptionactions()Returns the list of actions contained in the plan in the ordering of their time specifiers.booleanAdds an action at a specified time specifier in the plan.voidclear()Removes all the actions of the plan.booleanReturns if an action is contained in the plan at a specified time specifier.booleanReturns if the plan is equal to an other object.getActionSet(int time)Returns the set of actions at a specified time specifier.inthashCode()Returns the hash code of this plan.protected booleanisTimeSpecifierOutOfBound(int time)Returns if a specified time specifier is invalid.doublemakespan()Returns the makespan of the plan.booleanremove(int time)Removes all the actions at a specified time specifier of the plan.booleanRemoves an action at a specified time specifier of the plan.Returns the ordered set of time specifiers used in this plan.Methods inherited from class fr.uga.pddl4j.plan.AbstractPlan
cost, getHierarchy, isEmpty, isHierarchical, setHierarchy, size
-
Constructor Details
-
ParallelPlan
public ParallelPlan()Creates a new empty parallel plan.- See Also:
AbstractPlan()
-
ParallelPlan
Creates a new parallel plan from an other. This constructor creates a deep copy of the specified plan.- Parameters:
other- the other plan.- See Also:
AbstractPlan(Plan)
-
-
Method Details
-
makespan
public final double makespan()Returns the makespan of the plan. The makespan of parallel plan is the number of parallel time step of the plan.- Returns:
- the makespan of the plan.
- See Also:
Plan.makespan()
-
timeSpecifiers
Returns the ordered set of time specifiers used in this plan.- Returns:
- the ordered set of time specifiers used in this plan.
- See Also:
Plan.timeSpecifiers()
-
actions
Returns the list of actions contained in the plan in the ordering of their time specifiers.- Returns:
- the ordered set of actions of the plan.
- See Also:
Plan.actions()
-
getActionSet
Returns the set of actions at a specified time specifier.- Parameters:
time- the time specifier.- Returns:
- the set of actions at a specified time specifier or null if no actions are scheduled in the plan at the the time specifier.
- See Also:
Plan.getActionSet(int)
-
add
Adds an action at a specified time specifier in the plan.- Parameters:
action- the action to add.time- the time specifier of the action in the plan.- Returns:
trueif the action was added;falseotherwise.- See Also:
Plan.add(int, Action)
-
remove
Removes an action at a specified time specifier of the plan.- Parameters:
action- the action to remove.time- the time specifier of the action in the plan to remove.- Returns:
trueif the action was removed;falseotherwise.- See Also:
Plan.remove(int, Action)
-
remove
public final boolean remove(int time)Removes all the actions at a specified time specifier of the plan.- Parameters:
time- the time specifier of the actions in the plan to remove.- Returns:
trueif the action was removed;falseotherwise.- See Also:
Plan.remove(int)
-
contains
Returns if an action is contained in the plan at a specified time specifier.- Parameters:
time- the time specifier.action- the action.- Returns:
trueif the specified action is contained in the plan at the specified time specifier;falseotherwise.- See Also:
Plan.contains(int, Action)
-
clear
public final void clear()Removes all the actions of the plan.- See Also:
Plan.clear()
-
equals
Returns if the plan is equal to an other object. A plan is equal to an other object if the object is an instance of the same class and have the same action at the same time specifier. The equals method uses the equal method of the class BitOp to compare actions.- Overrides:
equalsin classObject- Parameters:
obj- the object to be compared.- Returns:
trueif this plan is equal to the specified object;falseotherwise.- See Also:
AbstractInstantiatedOperator.equals(Object),Object.equals(Object)
-
hashCode
public int hashCode()Returns the hash code of this plan.- Overrides:
hashCodein classObject- Returns:
- the hash code of this plan.
- See Also:
Object.hashCode()
-
isTimeSpecifierOutOfBound
protected final boolean isTimeSpecifierOutOfBound(int time)Returns if a specified time specifier is invalid. Formally a time specifier is invalid if it is less than 0 or greater than the size of the plan.- Parameters:
time- the time stamp.- Returns:
trueif the specified time specifier is out of bound;falseotherwise.
-