org.processmining.analysis.performance
Class TransitionAnalysis

java.lang.Object
  extended by org.processmining.analysis.performance.TransitionAnalysis

public class TransitionAnalysis
extends java.lang.Object

This is class is needed to calculate metrics concerning two transitions. Most importantly, the (avg,min,max etc.) time-in-between the two transitions can be calculated. Where time in between two transitions for a certain process instance is the time between the first firing of the one transition and the first firing of the other transition.

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

Constructor Summary
TransitionAnalysis(ExtendedTransition lastTrans, ExtendedTransition otherTrans)
          Initialize object of TransitionAnalysisResult with transitions lastTrans and otherTrans
 
Method Summary
 void calculateMetrics(java.util.ArrayList piList, int fitOption, java.util.HashSet failedInstances)
          Calculates the average, maximal and minimum time tokens spend between the two transitions, and the standard deviation in this time, and averages of the fastest, slowest and normal time-in-betweens.
 void exportToFile(java.util.ArrayList piList, java.io.File file, long divider, java.lang.String sort, int fitOption)
          Exports all time-in-between measurements corresponding to this TransitionAnalysis to a comma-seperated text-file.
 double[] getAverageTimes(double fastestPercentage, double slowestPercentage)
          Calculates the average of the (fastestpercentage) fast traces, the (slowestPercentage) slow traces and the (100% - fastestPercentage - slowestPercentage) normal speed traces and returns these averages in an array, where [0]: avg fast time in between [1]: avg slow time in between [2]: avg middle time in between
 long getFrequency()
          Returns the frequency of process instances in which both transitions appear.
 double getMaxTime()
          Returns the maximal time tokens spend between the two transitions.
 double getMeanTime()
          Returns the average time tokens spend between the two transitions.
 double getMinTime()
          Returns the minimum time tokens spend between the two transitions.
 int[] getSizes(double fastestPercentage, double slowestPercentage)
          Returns an array containing the number of process instances that are considered to be fast, i.e.
 double getStdevTimeInBetween()
          Calculates and returns the value of the standard deviation of the time-in-between transition last and transition other.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransitionAnalysis

public TransitionAnalysis(ExtendedTransition lastTrans,
                          ExtendedTransition otherTrans)
Initialize object of TransitionAnalysisResult with transitions lastTrans and otherTrans

Parameters:
lastTrans - ExtendedTransition: one of the two transitions
otherTrans - ExtendedTransition: one of the two transitions
Method Detail

calculateMetrics

public void calculateMetrics(java.util.ArrayList piList,
                             int fitOption,
                             java.util.HashSet failedInstances)
Calculates the average, maximal and minimum time tokens spend between the two transitions, and the standard deviation in this time, and averages of the fastest, slowest and normal time-in-betweens. Next to this, the frequency of cases in which both transitions fire is calculated. Results of the calculations are stored in corresponding instance-variables.

Parameters:
piList - ArrayList: The process instances on which calculations are based
fitOption - int: The fit option used (how to deal with non-conformance)

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-in-between measurements corresponding to this TransitionAnalysis to a comma-seperated text-file.

Parameters:
piList - ArrayList: the Process instances used
file - File: the file to which the measurements should be exported
divider - long: the time divider used
sort - String: the time sort used
fitOption - int: The fit option used (how to deal with non-conformance) *
Throws:
java.io.IOException

getMeanTime

public double getMeanTime()
Returns the average time tokens spend between the two transitions.

Returns:
double

getMaxTime

public double getMaxTime()
Returns the maximal time tokens spend between the two transitions.

Returns:
double

getMinTime

public double getMinTime()
Returns the minimum time tokens spend between the two transitions.

Returns:
double

getStdevTimeInBetween

public double getStdevTimeInBetween()
Calculates and returns the value of the standard deviation of the time-in-between transition last and transition other.

Returns:
double

getAverageTimes

public double[] getAverageTimes(double fastestPercentage,
                                double slowestPercentage)
Calculates the average of the (fastestpercentage) fast traces, the (slowestPercentage) slow traces and the (100% - fastestPercentage - slowestPercentage) normal speed traces and returns these averages in an array, where [0]: avg fast time in between [1]: avg slow time in between [2]: avg middle time in between

Parameters:
fastestPercentage - double: the percentage of measurements that is to be counted as fast
slowestPercentage - double: the percentage of measurements that is to be counted as slow
Returns:
double[]

getSizes

public int[] getSizes(double fastestPercentage,
                      double slowestPercentage)
Returns an array containing the number of process instances that are considered to be fast, i.e. have a low time in between (place 0 in array), the number of process instances that are slow (place 1 in array) and the number of process instances that are considered to be of normal speed (place 2 in array). Based on fastestPercentage, slowestPercentage and the values in timeStats (thus method calculateTimeInBetweenMetrics() should be called before this one)

Parameters:
fastestPercentage - double: the percentage of measurements that is to be counted as fast
slowestPercentage - double: the percentage of measurements that is to be counted as slow
Returns:
int[]

getFrequency

public long getFrequency()
Returns the frequency of process instances in which both transitions appear.

Returns:
long