org.processmining.analysis.decisionmining
Class DecisionCategory

java.lang.Object
  extended by org.processmining.analysis.decisionmining.DecisionCategory

public class DecisionCategory
extends java.lang.Object

A decision category represents one alternative branch spawned by a decision point. It is characterized by one or more log events, each indicating that the corresponding path has been taken with respect to an event log.
The case that there are more than one log event characterizing the decision category occurs if there are invisible tasks directly following the decision point (which in turn spawn further parallel or alternative paths). The list of log events must then be understood as a disjunction, i.e., the occurrence of each of the events in the log is sufficient to determine that that path has been taken.
A category can also be empty if there are no visible tasks contained in that alternative branch (i.e., from a log perspective it cannot be determined whether this path has been taken).

Author:
arozinat (a.rozinat@tm.tue.nl)

Constructor Summary
DecisionCategory(DecisionPoint parent, int ID, java.util.ArrayList logEvents, ModelGraphVertex target)
          Creates a new decision category for the given decision point.
 
Method Summary
 void addDecisionRule(java.lang.String rule)
          Adds the given rule to the rule set for this decision class.
 void cleanDecisionRules()
          Removes all decision rules attached to this data dependency.
 boolean contains(LogEvent toCompare)
          Determines whether the given log event is associated to this decision category.
 java.util.ArrayList getAssociatedLogEvents()
          Retrieves the log events associated to this decision class.
 java.lang.String getBranchSpecification()
          Returns the list of log events that indicate the occurrence of this alternative branch.
 java.lang.String getDataDependencyExpression()
          Creates a data dependency expression that can be readily included in a CPN guard condition representing that data dependency.
 java.lang.String getID()
          Creates a compound ID of the form "ParentDecisionPointID.DecisionCategoryID", which can be, e.g., used for serialization.
 ModelGraphVertex getTargetNode()
          Retrieves the target node of the data dependency associated to this decision category (i.e., the first transition on this alternative branch).
 boolean isEmpty()
          Determines whether there is at least one log event associated to this decision category that indicates its occurrence with respect to the log.
 java.lang.String toString()
          Creates a name for this decision category based on the associated log events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DecisionCategory

public DecisionCategory(DecisionPoint parent,
                        int ID,
                        java.util.ArrayList logEvents,
                        ModelGraphVertex target)
Creates a new decision category for the given decision point.

Parameters:
parent - the belonging decisin point
ID - the local ID with respect to the belonging decision point
logEvents - the log events associated to this category
target - the target node of the data dependency associated to this decision category (necessary for exporting a simulation model to CPN)
Method Detail

getTargetNode

public ModelGraphVertex getTargetNode()
Retrieves the target node of the data dependency associated to this decision category (i.e., the first transition on this alternative branch).

Returns:
the target node of this decision class

getID

public java.lang.String getID()
Creates a compound ID of the form "ParentDecisionPointID.DecisionCategoryID", which can be, e.g., used for serialization.

Returns:
the global ID of this decision category

toString

public java.lang.String toString()
Creates a name for this decision category based on the associated log events.

Overrides:
toString in class java.lang.Object
Returns:
a descriptive string containing the ID and the associated log events for this decision category

getBranchSpecification

public java.lang.String getBranchSpecification()
Returns the list of log events that indicate the occurrence of this alternative branch.

Returns:
the list of log events for this branch

isEmpty

public boolean isEmpty()
Determines whether there is at least one log event associated to this decision category that indicates its occurrence with respect to the log.

Returns:
false if there is at least one log event assigned to this category, true otherwise

contains

public boolean contains(LogEvent toCompare)
Determines whether the given log event is associated to this decision category.

Parameters:
toCompare - the log event to be compared with the assigned log events
Returns:
true if there could be a log event found in the list that is equal to the given one, false otherwise

getAssociatedLogEvents

public java.util.ArrayList getAssociatedLogEvents()
Retrieves the log events associated to this decision class. If the first task in an alternative branch is an invisible or duplicate task it must be traced and there may be more than one log event associated. In this case each of the log events indicates the occurrence of this decision class.

Returns:
the list of log events

addDecisionRule

public void addDecisionRule(java.lang.String rule)
Adds the given rule to the rule set for this decision class. Note that all provided rules are together interpreted as a disjunction.

Parameters:
rule - the rule to be added to this decision class
See Also:
getDataDependencyExpression()

cleanDecisionRules

public void cleanDecisionRules()
Removes all decision rules attached to this data dependency. This method should be called as soon as new rules have been calculated and should be updated.


getDataDependencyExpression

public java.lang.String getDataDependencyExpression()
Creates a data dependency expression that can be readily included in a CPN guard condition representing that data dependency.
This means that the expression is logically composed of AND (CPN: andalso) and OR (CPN: orelse) connectors over data attribute statements (CPN: #attributeName data).

Returns:
the data dependency expression if available, an empty string otherwise