org.processmining.analysis.conformance
Class DiagnosticLogEventRelation

java.lang.Object
  extended by org.processmining.analysis.conformance.DiagnosticLogEventRelation

public class DiagnosticLogEventRelation
extends java.lang.Object

Data structure for keeping track of the log event relations in a log trace or an execution trace of a model.
Note that this class can be used both to represent the relations between log events in a trace or model execution path and to capture the whole behavioral relation for the log or the process model. TODO - consider making subclasses implementing these two different behaviors!

Author:
arozinat
See Also:
addDiagnosticLogEvent, updateLogEventRelation

Constructor Summary
DiagnosticLogEventRelation()
           
 
Method Summary
 void addDiagnosticLogEvent(java.lang.String name, java.lang.String type)
          Registers a new activity for current log trace.
 boolean areInABRelation(java.lang.String first, java.lang.String second)
          Determines whether the given elements are in Always Precedes relation.
 boolean areInABRelation(java.lang.String first, java.lang.String second, int threshold)
          Determines whether the given elements are in Always Precedes relation.
 boolean areInAFRelation(java.lang.String first, java.lang.String second)
          Determines whether the given elements are in Always Follows relation.
 boolean areInAFRelation(java.lang.String first, java.lang.String second, int threshold)
          Determines whether the given elements are in Always Follows relation.
 boolean areInNBRelation(java.lang.String first, java.lang.String second)
          Determines whether the given elements are in Never Precedes relation.
 boolean areInNBRelation(java.lang.String first, java.lang.String second, int threshold)
          Determines whether the given elements are in Never Precedes relation.
 boolean areInNFRelation(java.lang.String first, java.lang.String second)
          Determines whether the given elements are in Never Follows relation.
 boolean areInNFRelation(java.lang.String first, java.lang.String second, int threshold)
          Determines whether the given elements are in Never Follows relation.
 boolean areInSBRelation(java.lang.String first, java.lang.String second)
          Determines whether the given elements are in Sometimes Precedes relation.
 boolean areInSBRelation(java.lang.String first, java.lang.String second, int threshold)
          Determines whether the given elements are in Sometimes Precedes relation.
 boolean areInSFRelation(java.lang.String first, java.lang.String second)
          Determines whether the given elements are in Sometimes Follows relation.
 boolean areInSFRelation(java.lang.String first, java.lang.String second, int threshold)
          Determines whether the given elements are in Sometimes Follows relation.
 void completeRelationByExternalZeroEntries(java.util.Collection<DiagnosticLogEvent> referenceEvents)
          Walks through all the local log event relations and adds a zero entry for those log events that are not present in the local relation.
 void completeRelationByZeroEntries()
          Walks through all the local log event relations and adds a zero entry for those log events that are not present in the local relation.
 DiagnosticLogEvent getDiagnosticLogEvent(java.lang.String namePlusType)
          Gets the specified log event from the internal list of log events.
 java.util.Collection<DiagnosticLogEvent> getDiagnosticLogEvents()
          Retrieves all diagnostic log events contained in this relation.
 void printOccurrenceCountsToMessageConsole()
          Prints how often any log event has occurred some time before or after each log event.
 void printRelationsToMessageConsole(int threshold)
          Writes the log event relations to the Message Console.
 void updateLogEventRelation(DiagnosticLogEvent newEvent, int similarInst)
          Updates the global log event relations with respect to the given log event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagnosticLogEventRelation

public DiagnosticLogEventRelation()
Method Detail

getDiagnosticLogEvents

public java.util.Collection<DiagnosticLogEvent> getDiagnosticLogEvents()
Retrieves all diagnostic log events contained in this relation.

Returns:
all diagnostic log events

getDiagnosticLogEvent

public DiagnosticLogEvent getDiagnosticLogEvent(java.lang.String namePlusType)
Gets the specified log event from the internal list of log events.

Parameters:
namePlusType - the string consisting of name and type specifies the log event to be retrieved
Returns:
the diagnostic log event if found, null otherwise

areInSFRelation

public boolean areInSFRelation(java.lang.String first,
                               java.lang.String second,
                               int threshold)
Determines whether the given elements are in Sometimes Follows relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
threshold - the threshold for the sometimes relation
Returns:
whether they are in sometimes follows relation (according to threshold)

areInSFRelation

public boolean areInSFRelation(java.lang.String first,
                               java.lang.String second)
Determines whether the given elements are in Sometimes Follows relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
Returns:
whether they are in sometimes follows relation (according to threshold 0)

areInSBRelation

public boolean areInSBRelation(java.lang.String first,
                               java.lang.String second,
                               int threshold)
Determines whether the given elements are in Sometimes Precedes relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
threshold - the threshold for the sometimes relation
Returns:
whether they are in sometimes Precedes relation (according to threshold)

areInSBRelation

public boolean areInSBRelation(java.lang.String first,
                               java.lang.String second)
Determines whether the given elements are in Sometimes Precedes relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
Returns:
whether they are in sometimes Precedes relation (according to threshold 0)

areInAFRelation

public boolean areInAFRelation(java.lang.String first,
                               java.lang.String second,
                               int threshold)
Determines whether the given elements are in Always Follows relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
threshold - the threshold for the Always relation
Returns:
whether they are in Always follows relation (according to threshold)

areInAFRelation

public boolean areInAFRelation(java.lang.String first,
                               java.lang.String second)
Determines whether the given elements are in Always Follows relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
Returns:
whether they are in Always follows relation (according to threshold 0)

areInABRelation

public boolean areInABRelation(java.lang.String first,
                               java.lang.String second,
                               int threshold)
Determines whether the given elements are in Always Precedes relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
threshold - the threshold for the Always relation
Returns:
whether they are in Always Precedes relation (according to threshold)

areInABRelation

public boolean areInABRelation(java.lang.String first,
                               java.lang.String second)
Determines whether the given elements are in Always Precedes relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
Returns:
whether they are in Always Precedes relation (according to threshold 0)

areInNFRelation

public boolean areInNFRelation(java.lang.String first,
                               java.lang.String second,
                               int threshold)
Determines whether the given elements are in Never Follows relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
threshold - the threshold for the Never relation
Returns:
whether they are in Never follows relation (according to threshold)

areInNFRelation

public boolean areInNFRelation(java.lang.String first,
                               java.lang.String second)
Determines whether the given elements are in Never Follows relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
Returns:
whether they are in Never follows relation (according to threshold 0)

areInNBRelation

public boolean areInNBRelation(java.lang.String first,
                               java.lang.String second,
                               int threshold)
Determines whether the given elements are in Never Precedes relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
threshold - the threshold for the Never relation
Returns:
whether they are in Never Precedes relation (according to threshold)

areInNBRelation

public boolean areInNBRelation(java.lang.String first,
                               java.lang.String second)
Determines whether the given elements are in Never Precedes relation.

Parameters:
first - the first element in the relation
second - the second element in the relation
Returns:
whether they are in Never Precedes relation (according to threshold 0)

addDiagnosticLogEvent

public void addDiagnosticLogEvent(java.lang.String name,
                                  java.lang.String type)
Registers a new activity for current log trace.
Call this method in order to add a newly observed log event for a log trace or possible execution trace in the model.

Parameters:
name - the name of the log event
type - the event type (such as start or complete)

updateLogEventRelation

public void updateLogEventRelation(DiagnosticLogEvent newEvent,
                                   int similarInst)
Updates the global log event relations with respect to the given log event.
Call this method in order to update the log relations for the whole log or process model.

Parameters:
newEvent -
similarInst -

completeRelationByZeroEntries

public void completeRelationByZeroEntries()
Walks through all the local log event relations and adds a zero entry for those log events that are not present in the local relation. This is needed in order to calculate the correct Never (and Sometimes) relations.


completeRelationByExternalZeroEntries

public void completeRelationByExternalZeroEntries(java.util.Collection<DiagnosticLogEvent> referenceEvents)
Walks through all the local log event relations and adds a zero entry for those log events that are not present in the local relation. This is needed in order to calculate the correct Never (and Sometimes) relations.

Parameters:
the - set of log events that should be covered by the relation

printRelationsToMessageConsole

public void printRelationsToMessageConsole(int threshold)
Writes the log event relations to the Message Console.

Parameters:
threshold - the barrier telling when something counts as happened "always" or "never".

printOccurrenceCountsToMessageConsole

public void printOccurrenceCountsToMessageConsole()
Prints how often any log event has occurred some time before or after each log event.