org.processmining.analysis.conformance
Class ConformanceMeasurer

java.lang.Object
  extended by org.processmining.framework.models.petrinet.algorithms.logReplay.Measurer
      extended by org.processmining.analysis.conformance.ConformanceMeasurer

public class ConformanceMeasurer
extends Measurer

Actually takes those measurements that are needed to calculate the selected conformance metrics.

Author:
arozinat

Constructor Summary
ConformanceMeasurer()
           
 
Method Summary
 void addMeanNumberEnabledMeasurement(int newNumberEnabled)
          This method is intended to add a new measurement to the mean number of enabled transitions.
 java.lang.String getFitnessAttributeForCurrentTrace()
          Calculates the fitness value for the currently replayed log trace.
 float getMeanNumberOfEnabledTransitions()
          Get the mean number of enabled transitions during log replay.
 int getNumberOfConsumedTokens()
          Get the number of consumed tokens while replaying that diagnostic trace.
 int getNumberOfProducedTokens()
          Get the number of produced tokens while replaying that diagnostic trace.
 boolean hasProperlyTerminated()
          Get the properlyTeminated value for that diagnostic trace.
 boolean hasSuccessfullyExecuted()
          Get the successfullyExecuted value for that diagnostic trace.
 void incrementConsumedTokens(int value)
          Increase the numberOfConsumedTokens attribute by the given value.
 void incrementProducedTokens(int value)
          Increase the numberOfProducedTokens attribute by the given value.
protected  LogReplayAnalysisResult initLogReplayAnalysisResult(AnalysisConfiguration analysisOptions, PetriNet petriNet, LogReader log, LogReplayAnalysisMethod analysisMethod)
          To be overridden in subclasses that want create custom analysis results. Creates an analysis result of type ConformanceLogReplayResult.
protected  void initTraceReplay(ReplayedLogTrace pi, LogReplayAnalysisResult result)
          Will be called at the very beginning of replaying a trace. Resets the log-based data structures for the replay of this trace.
 void setProperlyTerminated(boolean value)
          Set the properlyTerminated attribute.
 void setSuccessfullyExecuted(boolean value)
          Set the properlyTerminated attribute.
protected  void takeFailedTaskMeasurement(ReplayedLogTrace pi, ReplayedTransition t, AuditTrailEntry ate)
          Will be called directly before a failed task becomes artificially enabled in order to progress with the log replay (non-blocking). The replay failure will be recorded for the corresponding trace, transition, and audit trail entry.
protected  void takeLogEventRecordingMeasurement(LogReplayAnalysisResult result, ReplayedLogTrace pi, AuditTrailEntry ate)
          Will be called directly after fetching the new log event from the currently replayed log trace. For the improved behavioral appropriateness metric one needs to keep track of the relations between log events.
protected  void takeMissingTokenMeasurement(ReplayedPlace p, ReplayedLogTrace pi)
          Will be called directly after artificially creating a new token for enabling a task that has failed execution during log replay. Records the missing token at the corresponding place in the Petri net.
protected  void takePostReplayMeasurement(LogReplayAnalysisResult result)
          Will be called after the whole replay of the log has finished.
protected  void takePostTraceReplayMeasurement(LogReplayAnalysisResult result, ReplayedLogTrace pi)
          Will be called directly after finishing replay of the current trace.
protected  void takePreStepExecutionMeasurement(LogReplayAnalysisResult result, ReplayedLogTrace pi)
          Will be called directly after fetching a new log event from the currently replayed log trace. For behavioral appropriateness metric the number of enabled transitions needs to be checked before each replay step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConformanceMeasurer

public ConformanceMeasurer()
Method Detail

initLogReplayAnalysisResult

protected LogReplayAnalysisResult initLogReplayAnalysisResult(AnalysisConfiguration analysisOptions,
                                                              PetriNet petriNet,
                                                              LogReader log,
                                                              LogReplayAnalysisMethod analysisMethod)
To be overridden in subclasses that want create custom analysis results. Creates an analysis result of type ConformanceLogReplayResult.

Overrides:
initLogReplayAnalysisResult in class Measurer
Parameters:
analysisOptions - the configuration object determining which parts of the analysis should be carried out (can be null, then all options are interpreted as enabled)

initTraceReplay

protected void initTraceReplay(ReplayedLogTrace pi,
                               LogReplayAnalysisResult result)
Will be called at the very beginning of replaying a trace. Resets the log-based data structures for the replay of this trace.

Overrides:
initTraceReplay in class Measurer
Parameters:
pi - (not used)
result - the result object filled by the log replay method

takePreStepExecutionMeasurement

protected void takePreStepExecutionMeasurement(LogReplayAnalysisResult result,
                                               ReplayedLogTrace pi)
Will be called directly after fetching a new log event from the currently replayed log trace. Does nothing per default (to be overridden in subclasses if necessary). For behavioral appropriateness metric the number of enabled transitions needs to be checked before each replay step.

Overrides:
takePreStepExecutionMeasurement in class Measurer
Parameters:
result - the result object filled by the log replay method
pi - the trace which is currently replayed

takeLogEventRecordingMeasurement

protected void takeLogEventRecordingMeasurement(LogReplayAnalysisResult result,
                                                ReplayedLogTrace pi,
                                                AuditTrailEntry ate)
Will be called directly after fetching the new log event from the currently replayed log trace. For the improved behavioral appropriateness metric one needs to keep track of the relations between log events.

Overrides:
takeLogEventRecordingMeasurement in class Measurer
Parameters:
result - the result object filled by the log replay method
pi - the trace which is currently replayed
ate - the log event occurrence currently replayed

takeFailedTaskMeasurement

protected void takeFailedTaskMeasurement(ReplayedLogTrace pi,
                                         ReplayedTransition t,
                                         AuditTrailEntry ate)
Will be called directly before a failed task becomes artificially enabled in order to progress with the log replay (non-blocking). Does nothing per default (to be overridden in subclasses if necessary). The replay failure will be recorded for the corresponding trace, transition, and audit trail entry.

Overrides:
takeFailedTaskMeasurement in class Measurer
Parameters:
pi - the trace which is currently replayed
t - the transition to be artificially enabled
ate - the audit trail entry relating to this failed execution

takeMissingTokenMeasurement

protected void takeMissingTokenMeasurement(ReplayedPlace p,
                                           ReplayedLogTrace pi)
Will be called directly after artificially creating a new token for enabling a task that has failed execution during log replay. Does nothing per default (to be overridden in subclasses if necessary). Records the missing token at the corresponding place in the Petri net.

Overrides:
takeMissingTokenMeasurement in class Measurer
Parameters:
p - the place for which the token is created
pi - the trace which is currently replayed

takePostTraceReplayMeasurement

protected void takePostTraceReplayMeasurement(LogReplayAnalysisResult result,
                                              ReplayedLogTrace pi)
Description copied from class: Measurer
Will be called directly after finishing replay of the current trace. Does nothing per default (to be overridden in subclasses if necessary).

Overrides:
takePostTraceReplayMeasurement in class Measurer
Parameters:
result - the result object filled by the log replay method
pi - the trace which is currently replayed

takePostReplayMeasurement

protected void takePostReplayMeasurement(LogReplayAnalysisResult result)
Description copied from class: Measurer
Will be called after the whole replay of the log has finished. Does nothing per default (to be overridden in subclasses if necessary).

Overrides:
takePostReplayMeasurement in class Measurer
Parameters:
result - the result object filled by the log replay method

setProperlyTerminated

public void setProperlyTerminated(boolean value)
Set the properlyTerminated attribute.

Parameters:
value - The new value to be set.

setSuccessfullyExecuted

public void setSuccessfullyExecuted(boolean value)
Set the properlyTerminated attribute.

Parameters:
value - The new value to be set.

incrementConsumedTokens

public void incrementConsumedTokens(int value)
Increase the numberOfConsumedTokens attribute by the given value.

Parameters:
value - The amount to be increased by.

incrementProducedTokens

public void incrementProducedTokens(int value)
Increase the numberOfProducedTokens attribute by the given value.

Parameters:
value - The amount to be increased by.

addMeanNumberEnabledMeasurement

public void addMeanNumberEnabledMeasurement(int newNumberEnabled)
This method is intended to add a new measurement to the mean number of enabled transitions.

Parameters:
newNumberEnabled - The new measurement for the number of enabled transitions.

getMeanNumberOfEnabledTransitions

public float getMeanNumberOfEnabledTransitions()
Get the mean number of enabled transitions during log replay.

Returns:
The mean number of enabled transitions for that log trace.

hasProperlyTerminated

public boolean hasProperlyTerminated()
Get the properlyTeminated value for that diagnostic trace.

Returns:
The boolean value of having properly terminated.

hasSuccessfullyExecuted

public boolean hasSuccessfullyExecuted()
Get the successfullyExecuted value for that diagnostic trace.

Returns:
The boolean value of having successfully executed.

getNumberOfConsumedTokens

public int getNumberOfConsumedTokens()
Get the number of consumed tokens while replaying that diagnostic trace.

Returns:
The amount of consumed tokens during log replay.

getNumberOfProducedTokens

public int getNumberOfProducedTokens()
Get the number of produced tokens while replaying that diagnostic trace.

Returns:
The amount of produced tokens during log replay.

getFitnessAttributeForCurrentTrace

public java.lang.String getFitnessAttributeForCurrentTrace()
Calculates the fitness value for the currently replayed log trace. This is used to write this diagnostic information back to the log.

Returns:
the fitness value as a String