Package org.drools.base.time
Class TimeUtils
java.lang.Object
org.drools.base.time.TimeUtils
A helper class with utility methods for
time related operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Interval[][]calculateTemporalDistance(Interval[][] constraintMatrix) This method calculates the transitive closure of the given adjacency matrix in order to find the temporal distance between each event represented in the adjacency matrix.static longparseTimeString(String time) Parses the given time String and returns the corresponding time in milliseconds
-
Constructor Details
-
TimeUtils
public TimeUtils()
-
-
Method Details
-
calculateTemporalDistance
This method calculates the transitive closure of the given adjacency matrix in order to find the temporal distance between each event represented in the adjacency matrix. For more information on the calculation of the temporal distance, please refer to the paper: "Discarding Unused Temporal Information in a Production System", by Dan Teodosiu and Gunter Pollak. This method also uses an adaptation of the Floyd-Warshall algorithm to calculate the transitive closure of the interval matrix. More information can be found here: http://en.wikipedia.org/wiki/Floyd-Warshall_algorithm The adaptation of the algorithm follows the definition of the path addition and path intersection operations as defined in the paper previously mentioned. The algorithm runs in O(n^3).- Parameters:
constraintMatrix- the starting adjacency matrix- Returns:
- the resulting temporal distance matrix
-
parseTimeString
Parses the given time String and returns the corresponding time in milliseconds- Parameters:
time-- Returns:
- Throws:
NullPointerException- if time is null
-