org.processmining.framework.models.petrinet.algorithms.logReplay
Class ReplayedTransition

java.lang.Object
  extended by att.grappa.Element
      extended by att.grappa.Node
          extended by org.processmining.framework.models.ModelGraphVertex
              extended by org.processmining.framework.models.petrinet.PNNode
                  extended by org.processmining.framework.models.petrinet.Transition
                      extended by org.processmining.framework.models.petrinet.algorithms.logReplay.ReplayedTransition
All Implemented Interfaces:
att.grappa.GrappaConstants, java.lang.Cloneable, LogEventProvider
Direct Known Subclasses:
DiagnosticTransition, ExtendedTransition

public class ReplayedTransition
extends Transition

A transition involved in the log replay analysis method.

Author:
Anne Rozinat Slightly adjusted for performance analysis purposes (Peter T.G.Hornix)
See Also:
ReplayedPlace, ReplayedPetriNet, LogReplayAnalysisMethod

Field Summary
 
Fields inherited from class org.processmining.framework.models.ModelGraphVertex
identifier, object2, value, visualObject
 
Fields inherited from class att.grappa.Node
defaultNamePrefix
 
Fields inherited from class att.grappa.Element
counter, highlight, linewidth, object, printAllAttributes, printDefaultAttributes, usePrintList, visible
 
Fields inherited from interface att.grappa.GrappaConstants
_NO_TYPE, ANONYMOUS_PREFIX, BBOX_ATTR, BBOX_HASH, BOX_SHAPE, BOX_TYPE, CLUSTERRANK_ATTR, COLOR_ATTR, COLOR_HASH, COLOR_TYPE, CUSTOM_ATTR, CUSTOM_HASH, CUSTOM_SHAPE, DELETION_MASK, DIAMOND_SHAPE, DIR_ATTR, DIR_HASH, DIR_TYPE, DISTORTION_ATTR, DISTORTION_HASH, DOUBLE_TYPE, DOUBLECIRCLE_SHAPE, DOUBLEOCTAGON_SHAPE, EDGE, EGG_SHAPE, FILLCOLOR_ATTR, FILLCOLOR_HASH, FONTCOLOR_ATTR, FONTCOLOR_HASH, FONTNAME_ATTR, FONTNAME_HASH, FONTSIZE_ATTR, FONTSIZE_HASH, FONTSTYLE_ATTR, FONTSTYLE_HASH, FONTSTYLE_TYPE, GRAPPA_BACKGROUND_COLOR_ATTR, GRAPPA_BACKGROUND_COLOR_HASH, GRAPPA_DELETION_STYLE_ATTR, GRAPPA_DELETION_STYLE_HASH, GRAPPA_FONTSIZE_ADJUSTMENT_ATTR, GRAPPA_FONTSIZE_ADJUSTMENT_HASH, GRAPPA_SELECTION_STYLE_ATTR, GRAPPA_SELECTION_STYLE_HASH, GRAPPA_SHAPE, HASHLIST_TYPE, HEIGHT_ATTR, HEIGHT_HASH, HEXAGON_SHAPE, HIGHLIGHT_MASK, HIGHLIGHT_OFF, HIGHLIGHT_ON, HIGHLIGHT_TOGGLE, HOUSE_SHAPE, IDENTXFRM, IMAGE_ATTR, IMAGE_HASH, INTEGER_TYPE, INVERTEDHOUSE_SHAPE, INVERTEDTRAPEZIUM_SHAPE, INVERTEDTRIANGLE_SHAPE, LABEL_ATTR, LABEL_HASH, LINE_SHAPE, LINE_TYPE, LOG10, LP_ATTR, LP_HASH, MARGIN_ATTR, MARGIN_HASH, MCIRCLE_SHAPE, MCLIMIT_ATTR, MCLIMIT_HASH, MDIAMOND_SHAPE, MINBOX_ATTR, MINBOX_HASH, MINLEN_ATTR, MINLEN_HASH, MINSIZE_ATTR, MINSIZE_HASH, MRECORD_SHAPE, MSQUARE_SHAPE, NBSP, NEW_LINE, NO_SHAPE, NODE, NODESEP_ATTR, NODESEP_HASH, OCTAGON_SHAPE, ORIENTATION_ATTR, ORIENTATION_HASH, OVAL_SHAPE, PACKAGE_PREFIX, PARALLELOGRAM_SHAPE, PATCH_ATTR, PATCH_HASH, PENTAGON_SHAPE, PERIPHERIES_ATTR, PERIPHERIES_HASH, PERIPHERY_GAP, PKG_LOWER, PKG_UPLOW, PKG_UPPER, PLAINTEXT_SHAPE, POINT_TYPE, PointsPerInch, POLYGON_SHAPE, POS_ATTR, POS_HASH, PRINTLIST_ATTR, PRINTLIST_HASH, RANKDIR_ATTR, RANKDIR_HASH, RANKSEP_ATTR, RANKSEP_HASH, RECORD_SHAPE, RECTS_ATTR, RECTS_HASH, ROTATION_ATTR, ROTATION_HASH, ROUNDEDBOX_SHAPE, SELECTION_MASK, SHAPE_ATTR, SHAPE_HASH, SHAPE_MASK, SHAPE_TYPE, SIDES_ATTR, SIDES_HASH, SIZE_ATTR, SIZE_HASH, SIZE_TYPE, SKEW_ATTR, SKEW_HASH, STRING_TYPE, STYLE_ATTR, STYLE_HASH, STYLE_TYPE, SUBGRAPH, SYSTEM, TAG_ATTR, TAG_HASH, TIP_ATTR, TIP_HASH, TRAPEZIUM_SHAPE, TRIANGLE_SHAPE, TRIPLEOCTAGON_SHAPE, TYPES_SHIFT, WEIGHT_ATTR, WEIGHT_HASH, WIDTH_ATTR, WIDTH_HASH
 
Constructor Summary
ReplayedTransition(Transition t, PetriNet net, java.util.ArrayList caseIDs)
          The constructor creates a normal transition but additionally initializes the diagnostic information for every process instance specified.
 
Method Summary
 void fireQuick(ReplayedLogTrace replayedTrace, java.util.Date timeStamp, Measurer measurer)
          Fires the transition like normally but in addition adds diagnostic information for the respective process instance.
 void fireSequenceOfTasks(java.util.ArrayList firingSequence, ReplayedPetriNet replayedNet, ReplayedLogTrace replayedTrace, java.util.Date timeStamp, Measurer measurer)
          Actually fire a given sequence of transitions in the given Petri net.
 java.util.ArrayList getShortestSequenceOfInvisibleTasks(ReplayedPetriNet replayedNet, int maxDepth)
          Check whether the transition might be enabled through one or more invisible transitions.
protected  void initDiagnosticDataStructures(java.util.ArrayList caseIDs)
          Initializes the diagnostic data structures.
 boolean isEnabled(ReplayedLogTrace replayedTrace, java.util.Date timeStamp, int maxDepth, Measurer measurer)
          Check whether this transition could be enabled through invisible tasks and do it if possible; i.e., the current marking of the net is changed (used to replay nets with invisible tasks correctly).
protected  void takeActivityMeasurement(ReplayedLogTrace trace, java.util.Date timestamp, java.util.Date transEnabled)
          Will be called directly when this transition has fired.
protected  void takePostFiringMeasurement(ReplayedLogTrace replayedTrace)
          Will be called directly after this transition has been fired.
protected  void takePreFiringMeasurement(ReplayedLogTrace replayedTrace, Measurer measurer)
          Will be called directly before this transition is fired.
protected  void takeTimeBetweenMeasurement(ReplayedLogTrace replayedTrace, java.util.Date timestamp)
          Will be called when this transition fires (during log replay).
 
Methods inherited from class org.processmining.framework.models.petrinet.Transition
clone, equals, fire, fire, fireQuick, fireQuick, getLogEvent, getModelElement, getNumber, hashCode, hasLogModelElement, isDuplicateTask, isEnabled, isEnabled, isInvisibleTask, isNegativeEnabled, setLogEvent, setModelElement, setNumber, toString, unFire, unFireQuick
 
Methods inherited from class org.processmining.framework.models.ModelGraphVertex
getIdentifier, getIncidentEdges, getInEdgesIterator, getNeighbors, getOutEdgesIterator, getPredecessors, getSuccessors, getValue, getVerticesOnlyPredecessor, getVerticesOnlySuccessor, getVerticesPredecessorAndSuccessor, setIdentifier, setValue
 
Methods inherited from class att.grappa.Node
addEdge, attributeType, edgeElements, findInEdgeByKey, findOutEdgeByKey, getCenterPoint, getInEdges, getOutEdges, getType, inDegree, inEdgeElements, isNode, outDegree, outEdgeElements, printNode, removeEdge
 
Methods inherited from class att.grappa.Element
addTag, attrNotOfInterest, attrOfInterest, bdfs, buildShape, canonString, canonValue, clearBBox, delete, getAttribute, getAttributePairs, getAttributeValue, getDefaultAttribute, getDefaultAttribute, getGraph, getGrappaNexus, getId, getIdKey, getLocalAttribute, getLocalAttributeKeys, getLocalAttributePairs, getName, getSubgraph, getThisAttribute, getThisAttributeValue, hasAttributeForKey, hasDefaultTag, hasDefaultTags, hasLocalTag, hasLocalTags, hasTag, hasTags, isEdge, isOfInterest, isSubgraph, listAttrsOfInterest, printElement, removeTag, removeTags, setAttribute, setAttribute, setDefaultAttribute, setDefaultAttribute, setDefaultAttribute, setDefaultAttribute, setIdKey, setSubgraph, setUserAttributeType, typeString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReplayedTransition

public ReplayedTransition(Transition t,
                          PetriNet net,
                          java.util.ArrayList caseIDs)
The constructor creates a normal transition but additionally initializes the diagnostic information for every process instance specified.
Note that the the copy constructor must be simulated on this level to assign the right Petri net to the new Transition, which eventually is required by Grappa.

Parameters:
t - the template transition for creating the object (to be passed to super class)
net - the Petri net it belongs to (to be passed to super class)
caseIDs - a list of strings, containing the IDs of those cases for which we want to store diagnostic results in deriving subclasses (see initDiagnosticDataStructures)
Method Detail

initDiagnosticDataStructures

protected void initDiagnosticDataStructures(java.util.ArrayList caseIDs)
Initializes the diagnostic data structures. Does nothing per default (to be overridden in subclasses if necessary).

Parameters:
caseIDs - a list of strings, containing the IDs of those cases for which we want to store diagnostic results in deriving subclasses

takePreFiringMeasurement

protected void takePreFiringMeasurement(ReplayedLogTrace replayedTrace,
                                        Measurer measurer)
Will be called directly before this transition is fired. Does nothing per default (to be overridden in subclasses if necessary).

Parameters:
replayedTrace - the case currently replayed
measurer - the measurer object in order to record diagnostic information

takePostFiringMeasurement

protected void takePostFiringMeasurement(ReplayedLogTrace replayedTrace)
Will be called directly after this transition has been fired. Does nothing per default (to be overridden in subclasses if necessary).

Parameters:
replayedTrace - the case currently replayed

fireQuick

public void fireQuick(ReplayedLogTrace replayedTrace,
                      java.util.Date timeStamp,
                      Measurer measurer)
Fires the transition like normally but in addition adds diagnostic information for the respective process instance.

Parameters:
replayedTrace - the trace currently replayed
timeStamp - the time stamp at which the transition is fired (can be null if the log does not contain time information)
measurer - the measurer object in order to record diagnostic information

takeTimeBetweenMeasurement

protected void takeTimeBetweenMeasurement(ReplayedLogTrace replayedTrace,
                                          java.util.Date timestamp)
Will be called when this transition fires (during log replay). It is needed to keep track of times-in-between transitions. Does nothing per default (to be overridden in subclasses if necessary).

Parameters:
replayedTrace - ReplayedLogTrace: the trace that is currently replayed
timestamp - Date

takeActivityMeasurement

protected void takeActivityMeasurement(ReplayedLogTrace trace,
                                       java.util.Date timestamp,
                                       java.util.Date transEnabled)
Will be called directly when this transition has fired. It is needed for calculation of activity-related times (such as execution time, throughput time) Does nothing per default (to be overridden in subclasses if necessary).

Parameters:
trace - ReplayedLogTrace The trace that is currently being replayed
timestamp - Date TimeStamp at which this transition has fired
transEnabled - Date TimeStamp at which this transition was enabled

isEnabled

public boolean isEnabled(ReplayedLogTrace replayedTrace,
                         java.util.Date timeStamp,
                         int maxDepth,
                         Measurer measurer)
Check whether this transition could be enabled through invisible tasks and do it if possible; i.e., the current marking of the net is changed (used to replay nets with invisible tasks correctly).

Parameters:
replayedTrace - the log trace for which the potential firings will be noted (can be null if no diagnostic information should be collected)
timeStamp - the time at which the transition should be enabled (can be null if the log does not contain time information)
maxDepth - the maximum depth of search for a sequence of invisible tasks. Limited search if maxDepth >= 0. The full state space will be constructed if maxDepth < 0
measurer - the measurer object in order to record diagnostic information
Returns:
true if could be enabled, false otherwise

fireSequenceOfTasks

public void fireSequenceOfTasks(java.util.ArrayList firingSequence,
                                ReplayedPetriNet replayedNet,
                                ReplayedLogTrace replayedTrace,
                                java.util.Date timeStamp,
                                Measurer measurer)
Actually fire a given sequence of transitions in the given Petri net. Note that the transitions do not need to be objects contained in the given net but their corresponding transition will be looked up using the equals() method. Note further that it is assumed that there is such a corresponding transition each and that their execution is seamlessly possible, i.e., all of them will be enabled.

Parameters:
firingSequence - the list of transitions to be fired
replayedNet - the Petri net currently replayed
replayedTrace - the trace currently replayed (can be null if no diagnostic information should be collected)
timeStamp - the time at which the transition should be enabled (can be null if the log does not contain time information)
measurer - the measurer object in order to record diagnostic information

getShortestSequenceOfInvisibleTasks

public java.util.ArrayList getShortestSequenceOfInvisibleTasks(ReplayedPetriNet replayedNet,
                                                               int maxDepth)
Check whether the transition might be enabled through one or more invisible transitions. The shortest sequence found will be delivered.

Parameters:
replayedNet - the Petri net currently replayed
maxDepth - the maximum depth of search for a sequence of invisible tasks. Limited search if maxDepth >= 0. The full state space will be constructed if maxDepth < 0
Returns:
the shortest sequence found (empty list if was enabled already), null otherwise