Class TemporalPlan

java.lang.Object
fr.uga.pddl4j.plan.AbstractPlan
fr.uga.pddl4j.plan.TemporalPlan
All Implemented Interfaces:
Plan, Serializable

public class TemporalPlan extends AbstractPlan
This class implements a temporal plan.
Since:
3.0
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new empty temporal plan.
    TemporalPlan​(Plan other)
    Creates a new temporal plan from an other.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the list of actions contained in the plan ordered depending on their time specifier.
    boolean
    add​(int time, Action action)
    Adds an action at a specified time specifier in the plan.
    void
    Removes all the actions of the plan.
    boolean
    contains​(int time, Action action)
    Returns if an action is contained in the plan at a specified time specifier.
    boolean
    equals​(Object obj)
    Returns if the plan is equal to an other object.
    getActionSet​(int time)
    Returns the set of actions at a specified time specifier.
    int
    Returns the hash code of this plan.
    double
    Returns the makespan of the plan.
    boolean
    remove​(int time)
    Removes all the actions at a specified time specifier of the plan.
    boolean
    remove​(int time, Action action)
    Removes an action at a specified time specifier of the plan.
    Returns the set of time specifiers used in this plan.

    Methods inherited from class fr.uga.pddl4j.plan.AbstractPlan

    cost, getHierarchy, isEmpty, isHierarchical, setHierarchy, size

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TemporalPlan

      public TemporalPlan()
      Creates a new empty temporal plan.
      See Also:
      AbstractPlan()
    • TemporalPlan

      public TemporalPlan(Plan other)
      Creates a new temporal 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 a sequential plan is its size.
      Returns:
      the makespan of the plan.
      See Also:
      Plan.size()
    • actions

      public final List<Action> actions()
      Returns the list of actions contained in the plan ordered depending on their time specifier.
      Returns:
      the ordered set of actions of the plan.
      See Also:
      Plan.actions()
    • timeSpecifiers

      public final Set<Integer> timeSpecifiers()
      Returns the set of time specifiers used in this plan.
      Returns:
      the set of time specifiers used in this plan.
      See Also:
      Plan.timeSpecifiers()
    • getActionSet

      public final Set<Action> getActionSet(int time)
      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

      public final boolean add(int time, Action action)
      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:
      true if the action was added; false otherwise.
      See Also:
      Plan.add(int, Action)
    • remove

      public final boolean remove(int time, Action action)
      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:
      true if the action was removed; false otherwise.
      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:
      true if the action was removed; false otherwise.
      See Also:
      Plan.remove(int)
    • contains

      public final boolean contains(int time, Action action)
      Returns if an action is contained in the plan at a specified time specifier.
      Parameters:
      time - the time specifier.
      action - the action.
      Returns:
      true if the specified action is contained in the plan at the specified time specifier; false otherwise.
      See Also:
      Plan.contains(int, Action)
    • clear

      public final void clear()
      Removes all the actions of the plan.
      See Also:
      Plan.clear()
    • equals

      public boolean equals(Object obj)
      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:
      equals in class Object
      Parameters:
      obj - the object to be compared.
      Returns:
      true if this plan is equal to the specified object; false otherwise.
      See Also:
      AbstractInstantiatedOperator.equals(Object), Object.equals(Object)
    • hashCode

      public int hashCode()
      Returns the hash code of this plan.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of this plan.
      See Also:
      Object.hashCode()