Package edu.fiu.jtlex.algorithms
Class InconsistencyDetector
java.lang.Object
edu.fiu.jtlex.algorithms.InconsistencyDetector
- All Implemented Interfaces:
IInconsistencyDetector
Default implementation for inconsistency detection
- Since:
- jTLEX 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new indeterminacy detector withGraphTCSPSolver
as default implementation.InconsistencyDetector
(IGraphTCSPSolver tcspSolver) Creates a new inconsistency detector with the givenIGraphTCSPSolver
implementation. -
Method Summary
Modifier and TypeMethodDescriptiongenerateInconsistentSubgraphs
(ITimeMLGraph timeMLGraph) Given a TimeML graph generates a set of subgraphs that contain all the links and nodes involved in the inconsistencies.generateSelfLoopingSubGraphs
(Set<ITimeMLLink> links, Set<ITimeMLNode> nodes) Given a set of links, identifies which are inconsistent self references, and produces a subgraph for each instance.boolean
isConsistent
(ITimeMLGraph timeMLGraph) A method to determine a graph's consistency.
-
Constructor Details
-
InconsistencyDetector
public InconsistencyDetector()Creates a new indeterminacy detector withGraphTCSPSolver
as default implementation.- Since:
- jTLEX 1.0
-
InconsistencyDetector
Creates a new inconsistency detector with the givenIGraphTCSPSolver
implementation.- Parameters:
tcspSolver
- An {}solver implementation- Throws:
NullPointerException
- If the TCSP solver is null- Since:
- jTLEX 1.0
-
-
Method Details
-
isConsistent
A method to determine a graph's consistency. This is done by creating a TCSP for the graph (TimeMLGraphTCSP
) presented by the graphs links and nodes trying to solve it. Note that to produce aTimeMLGraphTCSP
the given graph cannot contain any S-Link. Consider partitioning the graph before checking for consistency. If there is a solution to the TCSP then the graph is consistent, otherwise it is inconsistent.- Specified by:
isConsistent
in interfaceIInconsistencyDetector
- Parameters:
timeMLGraph
- A timeML graph without S-Link.- Returns:
- true if the graph is consistent, else false
- Throws:
NullPointerException
- If the graph is nullIllegalStateException
- If the timeMLGraph contains any S-Link- Since:
- jTLEX 1.0
- See Also:
-
generateSelfLoopingSubGraphs
public Set<ITimeMLGraph> generateSelfLoopingSubGraphs(Set<ITimeMLLink> links, Set<ITimeMLNode> nodes) Given a set of links, identifies which are inconsistent self references, and produces a subgraph for each instance.- Specified by:
generateSelfLoopingSubGraphs
in interfaceIInconsistencyDetector
- Parameters:
links
- A set of links.nodes
- A set of nodes.- Returns:
- A set of IGraphs, each containing inconsistent self looping nodes.
- Throws:
NullPointerException
- If links is null.- Since:
- jTLEX 1.0
-
generateInconsistentSubgraphs
Given a TimeML graph generates a set of subgraphs that contain all the links and nodes involved in the inconsistencies. This is done in a four steps process:-
Find the self looping links, generate a subgraph for each of them,
and add it to the output set. For more details see:
generateSelfLoopingSubGraphs(Set, Set)
- Separate links into two partitions: consistent and inconsistent ones. This is done by adding each non self looping link to an empty graph and testing its consistency. If the added link makes the graph inconsistent, it is added to the inconsistent partition, else to the consistent one.
-
For each link in the inconsistent partition, complete its cycle by adding
it along with links from the consistent partition to an empty graph
until the graph becomes inconsistent. Once the cycle is produced, add it to the
output set. For more details see:
completeInconsistentCycle(ITimeMLGraph, List, ITimeMLGraph)
- Since some cycles can have shared edges, step 3 is repeated for each link in the inconsistent cycle that is not the initial inconsistent link.
- Specified by:
generateInconsistentSubgraphs
in interfaceIInconsistencyDetector
- Parameters:
timeMLGraph
- TimeML graph to evaluate.- Returns:
- A set containing the inconsistent subgraphs.
- Throws:
NullPointerException
- If the graph is null- Since:
- jTLEX 1.0
-
Find the self looping links, generate a subgraph for each of them,
and add it to the output set. For more details see:
-