org.processmining.analysis.performance
Class ExtendedPlace

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.Place
                      extended by org.processmining.framework.models.petrinet.algorithms.logReplay.ReplayedPlace
                          extended by org.processmining.analysis.performance.ExtendedPlace
All Implemented Interfaces:
att.grappa.GrappaConstants, java.lang.Cloneable, java.lang.Comparable

public class ExtendedPlace
extends ReplayedPlace

This class is used to be able to extend places with performance information, which is to be stored during log replay and will be used to form a part of the extended Petri net.

Author:
Peter T.G. Hornix (p.t.g.hornix@student.tue.nl)

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
ExtendedPlace(Place p, PetriNet net, java.util.ArrayList caseIDs)
          The constructor creates a normal place but additionally initializes
 
Method Summary
 void calculateMetrics(java.util.ArrayList piList, int fitOption, java.util.HashSet failedInstances)
          takes the waiting time, synchronization time and the sojourn time of each timemeasurement and puts them in the sorted arrays waitArray, synchArray and sojArray respectively.
 java.lang.Object clone()
          Makes a deep copy of the object.
 void exportToFile(java.util.ArrayList piList, java.io.File file, long divider, java.lang.String sort, int fitOption)
          Exports all time measurements (waiting, synchronization, sojourn time) taken in process instances in piList and corresponding to this place to (a comma-seperated text) file.
 double getArrivalRate()
          Returns the arrival rate of cases in this place.
 double[] getAvgTimes(double fastestPercentage, double slowestPercentage)
          Returns the average of fast, slow and normal speed waiting/synch/soj times Where [0..2]: fast wait-sync-soj [3..5]: slow wait-sync-soj [6..8]: middle wait-sync-soj
 java.util.ArrayList getBounds()
          Returns the bounds of the place's bottleneck settings
 java.util.ArrayList getColors()
          Returns the colors of the place's bottleneck settings
 long getFrequency()
          Returns the frequency of cases that have visited this place, based on the process instances in piList, make sure calculateMetrics is called before this method
 double getMaxSojournTime()
          Returns the maximum sojourn time of this place, based on the sojourn times as present in sojStatistics (make sure method calculateMetrics is called before this method.
 double getMaxSynchronizationTime()
          Returns the maximum synchronization time of this place, based on the synchronization times in syncStatistics, make sure calculateMetrics is called before this method
 double getMaxWaitingTime()
          Returns the maximum waiting time of this place, based on the waiting times in array waitStatistics (make sure method calculateMetrics is called before this one)
 double getMeanSojournTime()
          Returns the mean sojourn time of this place, calculated based on the sojourn times as present in sojStatistics (make sure method calculateMetrics is called before this method.
 double getMeanSynchronizationTime()
          Returns the mean waiting time of this place, calculated based on the times in syncStatistics.
 double getMeanWaitingTime()
          Returns the mean waiting time of this place, calculated based on the times in waitStatistics.
 double getMinSojournTime()
          Returns the minimum sojourn time of this place, based on the sojourn times as present in sojStatistics (make sure method calculateMetrics is called before this method.
 double getMinSynchronizationTime()
          Returns the minimum synchronization time of this place, based on the synchronization times in syncStatistics, make sure calculateMetrics is called before this method
 double getMinWaitingTime()
          Returns the minimum waiting time of this place, based on the waiting times in array waitStatistics (make sure method calculateMetrics is called before this one)
 java.util.ArrayList getRelatedTransitions()
          Returns the transitions that are related to this place, i.e., all transitions for which this place is an input or an output place.
 int[] getSizes(double fastestPercentage, double slowestPercentage)
          Returns an array containing the number of measurements that are considered to be fast (place 0 in array), the number of measurements that are considered to be slow (place 1 in array) and the number of measurements that are of 'normal' speed (place 2 in array).
 double getStdevSojournTime()
          Returns the standard deviation in sojourn time of this place, based on piList and meanTime.
 double getStdevSynchronizationTime()
          Returns the standard deviation in synchronization time of this place, based on the waiting times in syncStatistics (make sure calculateMetrics is called before this method) and meanTime.
 double getStdevWaitingTime()
          Returns the standard deviation in waiting time of this place, based on the waiting times in waitStatistics (make sure calculateMetrics is called before this method) and meanTime.
 long getTotalOutEdgeFrequency(java.util.ArrayList piList, int fitOption, java.util.HashSet failedInstances)
          Returns the total frequency of tokens that leave this place in a regular fashion (not artificially), counting only the process instances in piList This method is needed to be able to calculate probabilities at XOR-splits
 boolean hasSettings()
          Returns true if the place has its own bottleneck settings, else false
 void recordTimeMeasurement(java.util.Date tokenAvailable, java.util.Date transEnabled, java.util.Date transFired, ReplayedLogTrace trace)
          Calculates the synchronization time and waiting time of one token in this place and stores it.
 void removeEnablingTransition(java.util.Date endTime, ReplayedLogTrace trace, ReplayedTransition rt)
          Removes the enabling transition and sets the final time of the activity corresponding to the enabling transition.
 void setEnablingTransition(ReplayedTransition trans)
          Sets the last transition that put a token in this place to trans
 void setHasOwnSettings(boolean has)
          sets hasSettings to has
 void setOwnSettings(java.util.ArrayList bnds, java.util.ArrayList cols)
          Sets waiting time settings specific for this place
 
Methods inherited from class org.processmining.framework.models.petrinet.algorithms.logReplay.ReplayedPlace
initDiagnosticDataStructures
 
Methods inherited from class org.processmining.framework.models.petrinet.Place
addToken, compareTo, equals, getNumber, getNumberOfTokens, getNumberOfTokens, getRandomAvailableToken, getRandomAvailableToken, hashCode, hasIdentifier, removeAllTokens, removeToken, removeToken, setNumber
 
Methods inherited from class org.processmining.framework.models.ModelGraphVertex
getIdentifier, getIncidentEdges, getInEdgesIterator, getNeighbors, getOutEdgesIterator, getPredecessors, getSuccessors, getValue, getVerticesOnlyPredecessor, getVerticesOnlySuccessor, getVerticesPredecessorAndSuccessor, setIdentifier, setValue, toString
 
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

ExtendedPlace

public ExtendedPlace(Place p,
                     PetriNet net,
                     java.util.ArrayList caseIDs)
The constructor creates a normal place but additionally initializes

Parameters:
p - The place (to be passed to super class).
net - The Petri net it belongs to (to be passed to super class).
caseIDs - The list of diagnostic log traces that want to be able to store results of the conformance analysis in this diagnostic place.
Method Detail

recordTimeMeasurement

public void recordTimeMeasurement(java.util.Date tokenAvailable,
                                  java.util.Date transEnabled,
                                  java.util.Date transFired,
                                  ReplayedLogTrace trace)
Calculates the synchronization time and waiting time of one token in this place and stores it.

Overrides:
recordTimeMeasurement in class ReplayedPlace
Parameters:
tokenAvailable - Date the Date at which a token was first available in this place
transEnabled - Date the Date at which the transition to fire was enabled
transFired - Date the Date at which the transition fired
trace - ReplayedLogTrace the process instance in which this measurement was taken

calculateMetrics

public void calculateMetrics(java.util.ArrayList piList,
                             int fitOption,
                             java.util.HashSet failedInstances)
takes the waiting time, synchronization time and the sojourn time of each timemeasurement and puts them in the sorted arrays waitArray, synchArray and sojArray respectively.

Parameters:
piList - ArrayList: the process instance on which the metrics
fitOption - int: the used fit option (how to deal with conformance)
failedInstances - HashSet: set of traces that executed executed unsuccessfully or terminated unproperly

exportToFile

public void exportToFile(java.util.ArrayList piList,
                         java.io.File file,
                         long divider,
                         java.lang.String sort,
                         int fitOption)
                  throws java.io.IOException
Exports all time measurements (waiting, synchronization, sojourn time) taken in process instances in piList and corresponding to this place to (a comma-seperated text) file.

Parameters:
piList - ArrayList: the process instances
file - File: the file to which the measurements are exported
divider - long: the used time divider
sort - String: the used time sort
fitOption - int: the fit option used (how to deal with non-conformance)
Throws:
java.io.IOException - : can occur when connecting to file

setEnablingTransition

public void setEnablingTransition(ReplayedTransition trans)
Sets the last transition that put a token in this place to trans

Overrides:
setEnablingTransition in class ReplayedPlace
Parameters:
trans - ReplayedTransition: the transition that last put a token in this place

removeEnablingTransition

public void removeEnablingTransition(java.util.Date endTime,
                                     ReplayedLogTrace trace,
                                     ReplayedTransition rt)
Removes the enabling transition and sets the final time of the activity corresponding to the enabling transition. But only when it is a different activity than the activity corresponding to transition rt

Overrides:
removeEnablingTransition in class ReplayedPlace
Parameters:
endTime - Date: the timestamp
trace - ReplayedLogTrace: the trace that is currently being replayed
rt - ReplayedTransition: the transition that called this method

setOwnSettings

public void setOwnSettings(java.util.ArrayList bnds,
                           java.util.ArrayList cols)
Sets waiting time settings specific for this place

Parameters:
bnds - ArrayList: the bounds of the waiting time levels for this place.
cols - ArrayList: the colors of the waiting time levels for this place

setHasOwnSettings

public void setHasOwnSettings(boolean has)
sets hasSettings to has

Parameters:
has - boolean

hasSettings

public boolean hasSettings()
Returns true if the place has its own bottleneck settings, else false

Returns:
boolean

getBounds

public java.util.ArrayList getBounds()
Returns the bounds of the place's bottleneck settings

Returns:
ArrayList

getColors

public java.util.ArrayList getColors()
Returns the colors of the place's bottleneck settings

Returns:
ArrayList

getRelatedTransitions

public java.util.ArrayList getRelatedTransitions()
Returns the transitions that are related to this place, i.e., all transitions for which this place is an input or an output place.

Returns:
ArrayList

getMeanWaitingTime

public double getMeanWaitingTime()
Returns the mean waiting time of this place, calculated based on the times in waitStatistics. Make sure method calculateMetrics is called before this one.

Returns:
double

getMinWaitingTime

public double getMinWaitingTime()
Returns the minimum waiting time of this place, based on the waiting times in array waitStatistics (make sure method calculateMetrics is called before this one)

Returns:
double

getMaxWaitingTime

public double getMaxWaitingTime()
Returns the maximum waiting time of this place, based on the waiting times in array waitStatistics (make sure method calculateMetrics is called before this one)

Returns:
double

getStdevWaitingTime

public double getStdevWaitingTime()
Returns the standard deviation in waiting time of this place, based on the waiting times in waitStatistics (make sure calculateMetrics is called before this method) and meanTime.

Returns:
double

getMeanSynchronizationTime

public double getMeanSynchronizationTime()
Returns the mean waiting time of this place, calculated based on the times in syncStatistics. Make sure method calculateMetrics is called before this one.

Returns:
double

getMinSynchronizationTime

public double getMinSynchronizationTime()
Returns the minimum synchronization time of this place, based on the synchronization times in syncStatistics, make sure calculateMetrics is called before this method

Returns:
double

getMaxSynchronizationTime

public double getMaxSynchronizationTime()
Returns the maximum synchronization time of this place, based on the synchronization times in syncStatistics, make sure calculateMetrics is called before this method

Returns:
double

getStdevSynchronizationTime

public double getStdevSynchronizationTime()
Returns the standard deviation in synchronization time of this place, based on the waiting times in syncStatistics (make sure calculateMetrics is called before this method) and meanTime.

Returns:
double

getMeanSojournTime

public double getMeanSojournTime()
Returns the mean sojourn time of this place, calculated based on the sojourn times as present in sojStatistics (make sure method calculateMetrics is called before this method.

Returns:
double

getMinSojournTime

public double getMinSojournTime()
Returns the minimum sojourn time of this place, based on the sojourn times as present in sojStatistics (make sure method calculateMetrics is called before this method.

Returns:
double

getMaxSojournTime

public double getMaxSojournTime()
Returns the maximum sojourn time of this place, based on the sojourn times as present in sojStatistics (make sure method calculateMetrics is called before this method.

Returns:
double

getStdevSojournTime

public double getStdevSojournTime()
Returns the standard deviation in sojourn time of this place, based on piList and meanTime.

Returns:
double

getAvgTimes

public double[] getAvgTimes(double fastestPercentage,
                            double slowestPercentage)
Returns the average of fast, slow and normal speed waiting/synch/soj times Where [0..2]: fast wait-sync-soj [3..5]: slow wait-sync-soj [6..8]: middle wait-sync-soj

Parameters:
fastestPercentage - double: percentage of 'fast' times
slowestPercentage - double: percentage of 'slow' times
Returns:
double[]

getSizes

public int[] getSizes(double fastestPercentage,
                      double slowestPercentage)
Returns an array containing the number of measurements that are considered to be fast (place 0 in array), the number of measurements that are considered to be slow (place 1 in array) and the number of measurements that are of 'normal' speed (place 2 in array). Based on fastestPercentage, slowestPercentage and waitArray (thus method calculateMetrics() should be called before this one)

Parameters:
fastestPercentage - double
slowestPercentage - double
Returns:
int[]

getFrequency

public long getFrequency()
Returns the frequency of cases that have visited this place, based on the process instances in piList, make sure calculateMetrics is called before this method

Returns:
long

getTotalOutEdgeFrequency

public long getTotalOutEdgeFrequency(java.util.ArrayList piList,
                                     int fitOption,
                                     java.util.HashSet failedInstances)
Returns the total frequency of tokens that leave this place in a regular fashion (not artificially), counting only the process instances in piList This method is needed to be able to calculate probabilities at XOR-splits

Parameters:
piList - ArrayList: the process instances
fitOption - int: the fit Option used (how to deal with conformance)
failedInstances - HashSet: set of traces that executed executed unsuccessfully or terminated unproperly
Returns:
long

getArrivalRate

public double getArrivalRate()
Returns the arrival rate of cases in this place.

Returns:
double

clone

public java.lang.Object clone()
Makes a deep copy of the object. Note that this method needs to be extended as soon as there are attributes added to the class which are not primitive or immutable.

Overrides:
clone in class Place
Returns:
Object the cloned object