org.processmining.framework.models.petrinet
Class Transition

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.Transition
All Implemented Interfaces:
att.grappa.GrappaConstants, java.lang.Cloneable, LogEventProvider
Direct Known Subclasses:
ColoredTransition, PDMTransition, ReplayedTransition

public class Transition
extends PNNode
implements LogEventProvider, java.lang.Cloneable

A transition is node in a Petri net. It is the active component in the Petri net structure, and when it fires then it removes a token from all its input places and produces a token for all its output places. This changes the marking, and therefore the state of the Peti net.
From the business process perspective, a transition corresponds to a step, or a task, in a Petri net process model.

Author:
bfvdonge
See Also:
PetriNet, Place, LogEvent

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
Transition(LogEvent logModelElement, PetriNet net)
          Constructor specifying the kind of log event.
Transition(PetriNet net)
          Basic constructor.
Transition(java.lang.String identifier, PetriNet net)
          Constructor specifying the name.
Transition(Transition t)
          Copy Constructor.
 
Method Summary
 java.lang.Object clone()
          Make a deep copy of the object.
 boolean equals(java.lang.Object o)
          Overridden to specify when two Petri net transitions are considered to be equal.
 void fire()
          Fires this transition.
 void fire(java.util.Date timestamp)
          Fires this transition at the given point in time.
 void fireQuick()
          Fires this transition.
 void fireQuick(java.util.Date timestamp)
          Fires this transition at the given point in time.
 LogEvent getLogEvent()
          Gets the log event belonging to this transition.
 LogEvent getModelElement()
          Deprecated. Please now use getLogEvent()
 int getNumber()
          Returns the number which is associated to this transition.
 int hashCode()
          Overridden to produce the same hash code for equal objects.
protected  boolean hasLogModelElement(LogEvent lme)
          Compares a given log event with the one associated to this transition.
 boolean isDuplicateTask()
          A task is considered as a duplicate task if there is at least one other task in the model which has the same log event associated.
 boolean isEnabled()
          Checks whether this transition is enabled.
 boolean isEnabled(java.util.Date timestamp)
          Checks whether this transition is enabled, taking time information into account.
 boolean isInvisibleTask()
          A task is considered invisible if there is no log event associated to it.
 boolean isNegativeEnabled()
          Checks whether this transition is negatively enabled.
 void setLogEvent(LogEvent lme)
          Sets the log event belonging to this transition.
 void setModelElement(LogEvent le)
          Deprecated. Please now use setLogEvent(LogEvent le)
 void setNumber(int n)
          Assigns a number to this transition.
 java.lang.String toString()
          Returns the name of the transition.
 void unFire()
          Unfires this transition.
 void unFireQuick()
          Unfires this transition.
 
Methods inherited from class org.processmining.framework.models.ModelGraphVertex
getIdentifier, getIncidentEdges, getInEdgesIterator, getNeighbors, getOutEdgesIterator, getPredecessors, getSuccessors, getValue, getVerticesOnlyPredecessor, getVerticesOnlySuccessor, getVerticesPredecessorAndSuccessor, setIdentifier, setValue
 
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

Transition

public Transition(LogEvent logModelElement,
                  PetriNet net)
Constructor specifying the kind of log event.

Parameters:
logModelElement - the log event associated
net - the Petri net it belongs to

Transition

public Transition(PetriNet net)
Basic constructor.

Parameters:
net - the Petri net it belongs to

Transition

public Transition(java.lang.String identifier,
                  PetriNet net)
Constructor specifying the name.

Parameters:
identifier - the name of the transition
net - the Petri net it belongs to

Transition

public Transition(Transition t)
Copy Constructor. Note that the Transition will think it exists in the same graph. If you want to copy it to another graph, call setSubgraph() explicitely.

Parameters:
t - the template transition
Method Detail

getModelElement

public LogEvent getModelElement()
Deprecated. Please now use getLogEvent()

Returns:
the stored LogEvent
See Also:
This method returns the current LogEvent the LogEventProvider has stored

setModelElement

public void setModelElement(LogEvent le)
Deprecated. Please now use setLogEvent(LogEvent le)

Parameters:
le - the LogEvent to store
See Also:
This method sets the LogEvent for the LogEventProvider to store

getLogEvent

public LogEvent getLogEvent()
Gets the log event belonging to this transition.

Specified by:
getLogEvent in interface LogEventProvider
Returns:
the log event associated

setLogEvent

public void setLogEvent(LogEvent lme)
Sets the log event belonging to this transition.

Specified by:
setLogEvent in interface LogEventProvider
Parameters:
lme - the new log event associated

setNumber

public void setNumber(int n)
Assigns a number to this transition.

Since the identifier of a transition is not necessarily unique (i.e., two transitions can have the same name) this method can be used to assign unique numbers to the transitions of a Petri net, if needed. getNumber() can be used to retrieve the number.

Parameters:
n - the number to be assigned

getNumber

public int getNumber()
Returns the number which is associated to this transition.

Since the identifier of a transition is not necessarily unique (i.e., two transitions can have the same name) this method can be used to retrieve unique numbers from the transitions of a Petri net, if needed. However, they are not associated automatically but must have been set using the setNumber(int i) method before.

Returns:
the number associated

toString

public java.lang.String toString()
Returns the name of the transition. Note that this is not necessarily unique for two different transitions, they can have the same name. For comparison the equals method should be used.

Overrides:
toString in class ModelGraphVertex
Returns:
the name of the transition

isEnabled

public boolean isEnabled()
Checks whether this transition is enabled. That is the case if there are sufficient tokens available on all its input places, i.e., as many as would be consumed when firing the transition.

Returns:
true if the transition is enabled, false otherwise
See Also:
isNegativeEnabled

fire

public void fire()
Fires this transition.

Note that this only happens if the transition is enabled. If this check is not needed, fireQuick() should be used instead.

The effect is that tokens are produced in the output places of this transition.

See Also:
isEnabled()

fireQuick

public void fireQuick()
Fires this transition.

Note that it is not checked whether the transition is enabled. If this is needed, fire() should be used instead.

The effect is that tokens are produced in the output places of this transition.


isEnabled

public boolean isEnabled(java.util.Date timestamp)
Checks whether this transition is enabled, taking time information into account. That is the case if, at the given point in time, there are sufficient tokens available on all its input places, i.e., as many as would be consumed when firing the transition.

Parameters:
timestamp - the time specified
Returns:
true if the transition is enabled, false otherwise

fire

public void fire(java.util.Date timestamp)
Fires this transition at the given point in time.

Note that this only happens if the transition is enabled. If this check is not needed, fireQuick(Date timestamp) should be used instead.

The effect is that tokens are produced in the output places of this transition.

Parameters:
timestamp - the time specified

fireQuick

public void fireQuick(java.util.Date timestamp)
Fires this transition at the given point in time.

Note that it is not checked whether the transition is enabled. If this is needed, fire(Date timestamp) should be used instead.

The effect is that tokens are produced in the output places of this transition.

Parameters:
timestamp - the time specified

isNegativeEnabled

public boolean isNegativeEnabled()
Checks whether this transition is negatively enabled. That is the case if there are sufficient tokens available on all its output places, i.e., as many as were produced when firing the transition.

Returns:
true if the transition is enabled, false otherwise
See Also:
isEnabled

unFire

public void unFire()
Unfires this transition. Note that this only happens if the transition is negatively enabled. If this check is not needed, unFireQuick() should be used instead.

See Also:
isNegativeEnabled

unFireQuick

public void unFireQuick()
Unfires this transition. Note that it is not checked whether the transition is negatively enabled. If this is needed, unFire() should be used instead.


hasLogModelElement

protected boolean hasLogModelElement(LogEvent lme)
Compares a given log event with the one associated to this transition.

Parameters:
lme - the log event to be compared with
Returns:
true if they are equal, false otherwise

isInvisibleTask

public boolean isInvisibleTask()
A task is considered invisible if there is no log event associated to it.

Returns:
true if this transition is an invisible task, false otherwise

isDuplicateTask

public boolean isDuplicateTask()
A task is considered as a duplicate task if there is at least one other task in the model which has the same log event associated.
Note that this leads to the fact that the occurrences of duplicate tasks cannot be distinguished in the event log. Note further that in the case of duplicate tasks the method findTransitions will return multiple tasks being associated to that log event.

Returns:
true if this transition is a duplicate task, false otherwise

equals

public boolean equals(java.lang.Object o)
Overridden to specify when two Petri net transitions are considered to be equal.
Two transitions are considered equal if they have the same name and if their preceding and succeeding places are also equal.

Overrides:
equals in class ModelGraphVertex
Parameters:
o - the Transition to be compared with
Returns:
true if the identifiers of the transitions and the identifiers of all input and output places are the same, false otherwise

hashCode

public int hashCode()
Overridden to produce the same hash code for equal objects.

Overrides:
hashCode in class java.lang.Object
Returns:
int The hash code calculated.

clone

public java.lang.Object clone()
Make 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.
Note further that the belonging Petri net is not cloned (so the cloned object will point to the same one as this object). Only the PetriNet.clone() method will update the reference correspondingly.

Overrides:
clone in class att.grappa.Node
Returns:
the cloned object