Class TemporalOrderingConstraintNetwork

java.lang.Object
fr.uga.pddl4j.problem.operator.AbstractOrderingConstraintNetwork
fr.uga.pddl4j.problem.time.TemporalOrderingConstraintNetwork
All Implemented Interfaces:
OrderingConstraintNetwork, Serializable

public class TemporalOrderingConstraintNetwork extends AbstractOrderingConstraintNetwork
This class implements a simple temporal network. This class is used to deal with temporal constraints in methods.
Since:
4.0
See Also:
Serialized Form
  • Constructor Details

    • TemporalOrderingConstraintNetwork

      public TemporalOrderingConstraintNetwork(TemporalOrderingConstraintNetwork other)
      Creates a new simple temporal network from another one. This constructor creates a deep copy of the simple temporal network in paramter.
      Parameters:
      other - the other simple temporal network to use to make the copy.
    • TemporalOrderingConstraintNetwork

      public TemporalOrderingConstraintNetwork()
      Creates a new empty simple temporal network.
    • TemporalOrderingConstraintNetwork

      public TemporalOrderingConstraintNetwork(int size)
      Creates a new simple temporal network with a specified size. The temporal relations between tasks are set to UNIVERSAL.
      Parameters:
      size - the number of tasks of the simple temporal network.
      See Also:
      TemporalRelation
  • Method Details

    • get

      public TemporalRelation get(int task1, int task2)
      Returns the temporal relation between two specified task.
      Parameters:
      task1 - the first task.
      task2 - the second task.
      Returns:
      the temporal relation between task1 and task2.
    • set

      public void set(int task1, int task2, TemporalRelation relation)
      Adds an ordering constraints between two specified tasks.
      Parameters:
      task1 - the first task.
      task2 - the second task.
      relation - the temporal relation between task1 and task2.
    • isConsistent

      public boolean isConsistent()
      Returns if the network is consistent or not.
      Returns:
      if the network is consistent or not.
    • transitiveClosure

      public void transitiveClosure()
      Compute the transitive closure of the relation in O(n^3).
    • removeTask

      public void removeTask(int task)
      TO DO: NOT IMPLEMENTED Remove a task of the ordering constraints network.
      Parameters:
      task - the task to removed.
    • size

      public int size()
      The number of tasks of the simple temporal network.
      Returns:
      number of tasks of the simple temporal network.
    • resize

      public void resize(int newSize)
      TO DO: NOT IMPLEMENTED Resize the ordering constraints network.
      Parameters:
      newSize - the new size.
    • isTotallyOrdered

      public boolean isTotallyOrdered()
      TO DO: NOT IMPLEMENTED Returns true if the simple temporal network is totally ordered.
      Returns:
      true if the simple temporal network is totally ordered.; false otherwise.
    • getTasksWithNoSuccessors

      public List<Integer> getTasksWithNoSuccessors()
      TO DO: NOT IMPLEMENTED Returns the list of tasks with no successors. The method works if only if the method transitiveClosure() was previously called.
      Returns:
      the list of tasks with no successors.
    • getTasksWithNoPredecessors

      public List<Integer> getTasksWithNoPredecessors()
      TO DO: NOT IMPLEMENTED Returns the list of tasks with no predecessors. The method works if only if the method transitiveClosure() was previously called.
      Returns:
      the list of tasks with no predecessors.
    • toString

      public String toString()
      Returns a string representation of the simple temporal network.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the simple temporal network.
    • main

      public static void main(String[] args)
      TO REMOVED.
      Parameters:
      args - no arguments.