Class PTraceImp

  • All Implemented Interfaces:
    edu.uci.ics.jung.graph.DirectedGraph<java.lang.Integer,​PDependency>, edu.uci.ics.jung.graph.Graph<java.lang.Integer,​PDependency>, edu.uci.ics.jung.graph.Hypergraph<java.lang.Integer,​PDependency>, java.io.Serializable, java.lang.Iterable<org.deckfour.xes.model.XEvent>, PTrace
    Direct Known Subclasses:
    PTraceExtendedAbstract

    public class PTraceImp
    extends edu.uci.ics.jung.graph.DirectedSparseGraph<java.lang.Integer,​PDependency>
    implements PTrace
    A graphical data model of the partially ordered trace. Information stored in this class includes (1) the original linear trace, (2) the trace index in the log (3) a list of boolean indicating the event is a visible move (or not), and (4) a list of activity number according to the delegate.

    The class has functions to get a (un)sorted and (un)filtered potrace in PartiallyOrderedTrace for A* alignment

    Author:
    xlu
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.deckfour.xes.model.XTrace trace  
      protected int traceIndex  
      • Fields inherited from class edu.uci.ics.jung.graph.DirectedSparseGraph

        edges, vertices
      • Fields inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph

        edge_type
    • Constructor Summary

      Constructors 
      Constructor Description
      PTraceImp​(org.deckfour.xes.model.XTrace trace, int traceIndex)
      Constructor to get a new PartiallyOrderedXTrace graph with empty nodes and edges
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addDependency​(PDependency relation, int sourceEventIndex, int targetEventIndex)  
      boolean addEvent​(int eventIndex)  
      java.util.Collection<PDependency> getDependencies()  
      PDependency getDependency​(int source, int target)  
      java.util.Set<java.lang.Integer> getEndEventIndices()  
      org.deckfour.xes.model.XEvent getEvent​(int index)  
      java.util.Collection<java.lang.Integer> getEventIndices()  
      java.util.Collection<java.lang.Integer> getPredecessorIndices​(int index)  
      java.util.Set<java.lang.Integer> getStartEventIndices()  
      java.util.Collection<java.lang.Integer> getSuccessorIndices​(int index)  
      org.deckfour.xes.model.XTrace getTrace()  
      int getTraceIndex()  
      java.util.Iterator<org.deckfour.xes.model.XEvent> iterator()  
      void setTraceIndex​(int i)  
      int size()  
      java.lang.String toString()  
      • Methods inherited from class edu.uci.ics.jung.graph.DirectedSparseGraph

        addEdge, addVertex, containsEdge, containsVertex, findEdge, findEdgeSet, getDest, getEdgeCount, getEdges, getEndpoints, getFactory, getIncidentEdges, getIncoming_internal, getInEdges, getNeighbors, getOutEdges, getOutgoing_internal, getPredecessors, getPreds_internal, getSource, getSuccessors, getSuccs_internal, getVertexCount, getVertices, isDest, isSource, removeEdge, removeVertex
      • Methods inherited from class edu.uci.ics.jung.graph.AbstractTypedGraph

        getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, hasEqualEdgeType, validateEdgeType
      • Methods inherited from class edu.uci.ics.jung.graph.AbstractGraph

        addEdge, addEdge, addEdge, addEdge, addEdge, degree, getIncidentCount, getIncidentVertices, getNeighborCount, getOpposite, getPredecessorCount, getSuccessorCount, getValidatedEndpoints, inDegree, isIncident, isNeighbor, isPredecessor, isSuccessor, outDegree
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface edu.uci.ics.jung.graph.Graph

        addEdge, addEdge, getOpposite, getPredecessorCount, getSuccessorCount, inDegree, isPredecessor, isSuccessor, outDegree
      • Methods inherited from interface edu.uci.ics.jung.graph.Hypergraph

        addEdge, addEdge, degree, getDefaultEdgeType, getEdgeCount, getEdges, getEdgeType, getIncidentCount, getIncidentVertices, getNeighborCount, isIncident, isNeighbor
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • trace

        protected org.deckfour.xes.model.XTrace trace
      • traceIndex

        protected int traceIndex
    • Constructor Detail

      • PTraceImp

        public PTraceImp​(org.deckfour.xes.model.XTrace trace,
                         int traceIndex)
        Constructor to get a new PartiallyOrderedXTrace graph with empty nodes and edges
        Parameters:
        trace - The linear XTrace of this partially ordered trace
        traceIndex - The index of the linear XTrace in the log
    • Method Detail

      • getDependency

        public PDependency getDependency​(int source,
                                         int target)
        Specified by:
        getDependency in interface PTrace
        Returns:
        A data relation between the two events, or null if there is no relation
      • getStartEventIndices

        public java.util.Set<java.lang.Integer> getStartEventIndices()
        Specified by:
        getStartEventIndices in interface PTrace
        Returns:
        A set of indices of events that have no predecessors.
      • getEndEventIndices

        public java.util.Set<java.lang.Integer> getEndEventIndices()
        Specified by:
        getEndEventIndices in interface PTrace
        Returns:
        A set of indices of event that have no successors.
      • addEvent

        public boolean addEvent​(int eventIndex)
        Specified by:
        addEvent in interface PTrace
      • getTrace

        public org.deckfour.xes.model.XTrace getTrace()
        Specified by:
        getTrace in interface PTrace
        Returns:
        The linear trace
      • getTraceIndex

        public int getTraceIndex()
        Specified by:
        getTraceIndex in interface PTrace
        Returns:
        The index of the linear trace in the log
      • setTraceIndex

        public void setTraceIndex​(int i)
        Specified by:
        setTraceIndex in interface PTrace
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class edu.uci.ics.jung.graph.AbstractGraph<java.lang.Integer,​PDependency>
      • getEventIndices

        public java.util.Collection<java.lang.Integer> getEventIndices()
        Specified by:
        getEventIndices in interface PTrace
      • size

        public int size()
        Specified by:
        size in interface PTrace
        Returns:
        The number of events
      • addDependency

        public boolean addDependency​(PDependency relation,
                                     int sourceEventIndex,
                                     int targetEventIndex)
        Specified by:
        addDependency in interface PTrace
      • getEvent

        public org.deckfour.xes.model.XEvent getEvent​(int index)
        Specified by:
        getEvent in interface PTrace
      • iterator

        public java.util.Iterator<org.deckfour.xes.model.XEvent> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<org.deckfour.xes.model.XEvent>
      • getPredecessorIndices

        public java.util.Collection<java.lang.Integer> getPredecessorIndices​(int index)
        Specified by:
        getPredecessorIndices in interface PTrace
      • getSuccessorIndices

        public java.util.Collection<java.lang.Integer> getSuccessorIndices​(int index)
        Specified by:
        getSuccessorIndices in interface PTrace