Package fr.uga.pddl4j.problem.time
Class TemporalOrderingConstraintNetwork
java.lang.Object
fr.uga.pddl4j.problem.operator.AbstractOrderingConstraintNetwork
fr.uga.pddl4j.problem.time.TemporalOrderingConstraintNetwork
- All Implemented Interfaces:
OrderingConstraintNetwork
,Serializable
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 Summary
ConstructorDescriptionCreates a new empty simple temporal network.TemporalOrderingConstraintNetwork(int size)
Creates a new simple temporal network with a specified size.Creates a new simple temporal network from another one. -
Method Summary
Modifier and TypeMethodDescriptionget(int task1, int task2)
Returns the temporal relation between two specified task.TO DO: NOT IMPLEMENTED Returns the list of tasks with no predecessors.TO DO: NOT IMPLEMENTED Returns the list of tasks with no successors.boolean
Returns if the network is consistent or not.boolean
TO DO: NOT IMPLEMENTED Returnstrue
if the simple temporal network is totally ordered.static void
TO REMOVED.void
removeTask(int task)
TO DO: NOT IMPLEMENTED Remove a task of the ordering constraints network.void
resize(int newSize)
TO DO: NOT IMPLEMENTED Resize the ordering constraints network.void
set(int task1, int task2, TemporalRelation relation)
Adds an ordering constraints between two specified tasks.int
size()
The number of tasks of the simple temporal network.toString()
Returns a string representation of the simple temporal network.void
Compute the transitive closure of the relation in O(n^3).
-
Constructor Details
-
TemporalOrderingConstraintNetwork
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
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
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 Returnstrue
if the simple temporal network is totally ordered.- Returns:
true
if the simple temporal network is totally ordered.;false
otherwise.
-
getTasksWithNoSuccessors
TO DO: NOT IMPLEMENTED Returns the list of tasks with no successors. The method works if only if the methodtransitiveClosure()
was previously called.- Returns:
- the list of tasks with no successors.
-
getTasksWithNoPredecessors
TO DO: NOT IMPLEMENTED Returns the list of tasks with no predecessors. The method works if only if the methodtransitiveClosure()
was previously called.- Returns:
- the list of tasks with no predecessors.
-
toString
Returns a string representation of the simple temporal network. -
main
TO REMOVED.- Parameters:
args
- no arguments.
-