org.processmining.exporting.petrinet.cpnexport.HLImplementation
Class HLTransition

java.lang.Object
  extended by org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLTransition
All Implemented Interfaces:
java.lang.Cloneable, HighLevelActivity, GuiDisplayable, GuiNotificationTarget

public class HLTransition
extends java.lang.Object
implements HighLevelActivity, GuiDisplayable, java.lang.Cloneable, GuiNotificationTarget

Defines the data operations that are available for a high-level activity. For this implementation of the HighLevelActivity and the implementation of the HighLevelProcess the following usage contracts exists.

Author:
arozinat, rmans

Nested Class Summary
static class HLTransition.ModificationType
          An enumeration type for whether a data attribute that is linked to a transition has to be resampled or reused
 
Constructor Summary
HLTransition(HLPetriNet parent)
          Default constructor.
 
Method Summary
 void addDataAttribute(HighLevelDataAttribute att)
          Adds a new data attribute to this activity.
 java.lang.Object clone()
          Makes a shallow copy of the object
 boolean equals(java.lang.Object obj)
          Determines when two highLevelActivities are the same.
 void existsDataDependency(boolean dep)
          Indicate whether a data dependency exists for this transition
 void existsProbabilityDependency(boolean dep)
          Indicate whether a possibility dependency exists for this transition
 java.util.List<HighLevelDataAttribute> getDataAttributes()
          Retrieves the list of data attributes available for this activity.
 Distribution getExecutionTime()
          Retrieves the distribution of the execution time for this activity.
 int getFrequencyDependency()
          Sets the frequency dependency specified for this activity.
 javax.swing.JPanel getFrequencyPanel()
          A panel representing this activity as a frequency dependency.
 HighLevelGroup getGroup()
          Retrieves the group for this activity.
 HLTransition.ModificationType getModificationTypeForDataAttribute(HighLevelDataAttribute att)
          Retrieves for the specified data attribute its modification type
 java.lang.String getName()
          Retrieves the name of the activity
 javax.swing.JPanel getPanel()
          Retrieves the GUI panel representing this object.
 Distribution getSojournTime()
          Retrieves the distribution of the sojourn time for this activity.
 Distribution getWaitingTime()
          Retrieves the distribution of the waiting time for this activity.
 boolean hasDataDependency()
          Retrieves whether a data dependency exists for this transition
 int hashCode()
          Retrieves the hashcode for the object.
 boolean hasProbabilityDependency()
          Retrieves whether a probability dependency exists for this transition
 java.lang.Object partialClone()
          Partially clones the object.
 void removeAllDataAttributes()
          Remove all data attributes from this transition.
 boolean removeDataAttribute(HighLevelDataAttribute att)
          Removes the given data attribute from this activity.
 void removeGroup()
          Removes the group from this activity.
 boolean removeGroup(HighLevelGroup grp)
          Removes the given group from this activity.
 void setExecutionTime(Distribution dist)
          Provides a distribution of the execution time for this activity.
 void setFrequencyDependency(int freq)
          Adds a frequency dependency to this activity. Note that it is assumed that the frequency value is not modified via this method anymore as soon as it is displayed as a GUI property for manual manupulation.
 void setGroup(HighLevelGroup group)
          Defines a group for this activity.
 void setModificationType(HighLevelDataAttribute att, HLTransition.ModificationType modType)
          Sets the modification type for the specified data attribute.
 void setName(java.lang.String name)
          Sets the name of the activity
 void setParentProcess(HighLevelProcess parent)
          Sets the parent process for this transition
 void setSojournTime(Distribution dist)
          Provides a distribution of the sojourn time for this activity.
 void setWaitingTime(Distribution dist)
          Provides a distribution of the waiting time for this activity.
 java.lang.String toString()
          Returns the name of this high level transtion.
 void updateGUI()
          This method will be called as soon as the associated GUI property has changed.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HLTransition

public HLTransition(HLPetriNet parent)
Default constructor.

Parameters:
parent - the petri net based simulation model
Method Detail

setName

public void setName(java.lang.String name)
Description copied from interface: HighLevelActivity
Sets the name of the activity

Specified by:
setName in interface HighLevelActivity
Parameters:
name - String the name

getName

public java.lang.String getName()
Description copied from interface: HighLevelActivity
Retrieves the name of the activity

Specified by:
getName in interface HighLevelActivity
Returns:
String the name of the activity

setParentProcess

public void setParentProcess(HighLevelProcess parent)
Sets the parent process for this transition

Specified by:
setParentProcess in interface HighLevelActivity
Parameters:
parent - HLPetriNet the parent process

clone

public java.lang.Object clone()
Makes a shallow copy of the object

Specified by:
clone in interface HighLevelActivity
Overrides:
clone in class java.lang.Object
Returns:
Object the cloned object

partialClone

public java.lang.Object partialClone()
Partially clones the object. All the timing information is cloned and the frequency dependency is cloned. However, the group that is attached to this object will not be cloned and for the data attributes a new EMPTY hashmap will be created

Specified by:
partialClone in interface HighLevelActivity
Returns:
Object the partially cloned object

setExecutionTime

public void setExecutionTime(Distribution dist)
Description copied from interface: HighLevelActivity
Provides a distribution of the execution time for this activity.
The execution time is defined as the time from the starting an activity until its completion.

Conflict: Note that there is a semantic conflict between

Specified by:
setExecutionTime in interface HighLevelActivity
Parameters:
dist - the distribution of the execution time
See Also:
HighLevelActivity.setWaitingTime(Distribution), HighLevelActivity.setSojournTime(Distribution), HighLevelProcess#setTimeUnit()

getExecutionTime

public Distribution getExecutionTime()
Description copied from interface: HighLevelActivity
Retrieves the distribution of the execution time for this activity.
The execution time is defined as the time from the starting an activity until its completion.

Conflict: Note that there is a semantic conflict between

Specified by:
getExecutionTime in interface HighLevelActivity
Returns:
the distribution of the execution time. In the case that no execution time has been set a default distribution has to be returned.
See Also:
HighLevelActivity.getWaitingTime(), HighLevelActivity.getSojournTime(), HighLevelProcess.getTimeUnit()

setWaitingTime

public void setWaitingTime(Distribution dist)
Description copied from interface: HighLevelActivity
Provides a distribution of the waiting time for this activity.
The waiting time is defined as the time from the point where an activity is enabled (that is, ready to be started) until its actual start.

Conflict: Note that there is a semantic conflict between

Specified by:
setWaitingTime in interface HighLevelActivity
Parameters:
dist - the distribution of the waiting time
See Also:
HighLevelActivity.setExecutionTime(Distribution), HighLevelActivity.setSojournTime(Distribution), HighLevelProcess#setTimeUnit()

getWaitingTime

public Distribution getWaitingTime()
Description copied from interface: HighLevelActivity
Retrieves the distribution of the waiting time for this activity.
The waiting time is defined as the time from the point where an activity is enabled (that is, ready to be started) until its actual start.

Conflict: Note that there is a semantic conflict between

Specified by:
getWaitingTime in interface HighLevelActivity
Returns:
the distribution of the waiting time. In the case that no waiting time has been set a default distribution has to be returned.
See Also:
HighLevelActivity.getExecutionTime(), HighLevelActivity.getSojournTime(), HighLevelProcess.getTimeUnit()

setSojournTime

public void setSojournTime(Distribution dist)
Description copied from interface: HighLevelActivity
Provides a distribution of the sojourn time for this activity.
The sojourn time is defined as the waiting time + the execution time.

Conflict: Note that there is a semantic conflict between

Specified by:
setSojournTime in interface HighLevelActivity
Parameters:
dist - the distribution of the sojourn time
See Also:
HighLevelActivity.setExecutionTime(Distribution), HighLevelActivity.setWaitingTime(Distribution), HighLevelProcess#setTimeUnit()

getSojournTime

public Distribution getSojournTime()
Description copied from interface: HighLevelActivity
Retrieves the distribution of the sojourn time for this activity.
The sojourn time is defined as the waiting time + the execution time.

Conflict: Note that there is a semantic conflict between

Specified by:
getSojournTime in interface HighLevelActivity
Returns:
the distribution of the sojourn time. In the case that no sojourn time has been set a default distribution has to be returned.
See Also:
HighLevelActivity.getExecutionTime(), HighLevelActivity.getWaitingTime(), HighLevelProcess.getTimeUnit()

setFrequencyDependency

public void setFrequencyDependency(int freq)
Adds a frequency dependency to this activity.
This relates to the (relative) frequency of chosing this activity if it is involved into an alternative split.

Conflict: Note further that there is a semantic conflict between Note that it is assumed that the frequency value is not modified via this method anymore as soon as it is displayed as a GUI property for manual manupulation.

Specified by:
setFrequencyDependency in interface HighLevelActivity
Parameters:
freq - the frequency dependency to be added
See Also:
HighLevelProcess#addDataDependency(DataDependency), HighLevelProcess#addProbabilityDependency(ProbabilityDependency)

getFrequencyDependency

public int getFrequencyDependency()
Description copied from interface: HighLevelActivity
Sets the frequency dependency specified for this activity.
This relates to the (relative) frequency of chosing this activity if it is involved into an alternative split.

Conflict: Note further that there is a semantic conflict between

Specified by:
getFrequencyDependency in interface HighLevelActivity
Returns:
the frequency dependency specified for this activity. If no frequency dependency has been set a default value needs to be returned.
See Also:
HighLevelProcess.getDataDependencies(), HighLevelProcess.getProbabilityDependencies()

addDataAttribute

public void addDataAttribute(HighLevelDataAttribute att)
Description copied from interface: HighLevelActivity
Adds a new data attribute to this activity. Note that if this data attribute had already been added to this process before, it will not be added again.

Specified by:
addDataAttribute in interface HighLevelActivity
Parameters:
att - the attributed to be added

removeDataAttribute

public boolean removeDataAttribute(HighLevelDataAttribute att)
Description copied from interface: HighLevelActivity
Removes the given data attribute from this activity.

Specified by:
removeDataAttribute in interface HighLevelActivity
Parameters:
att - the attribute to be removed
Returns:
true if the data attribute was found and removed, false otherwise

getDataAttributes

public java.util.List<HighLevelDataAttribute> getDataAttributes()
Description copied from interface: HighLevelActivity
Retrieves the list of data attributes available for this activity.

Note that this list should be consistent with (i.e., a sub set of) the data attributes available at the process level (if there is an enclosing process for this activity).

Specified by:
getDataAttributes in interface HighLevelActivity
Returns:
the list of HighLevelDataAttribute objects representing the attributes provided by this activity. If no data attributes have been set an empty list needs to be returned

setGroup

public void setGroup(HighLevelGroup group)
Description copied from interface: HighLevelActivity
Defines a group for this activity.
Note that if no group is set, every resource can execute this activity. Note further that we assume that every activity is executed by only one resource.

Specified by:
setGroup in interface HighLevelActivity
Parameters:
group - the group of resources that may execute this activity

getGroup

public HighLevelGroup getGroup()
Description copied from interface: HighLevelActivity
Retrieves the group for this activity.
Note that if no group is set, every resource can execute this activity. Note further that we assume that every activity is executed by only one resource.

Specified by:
getGroup in interface HighLevelActivity
Returns:
the group of resources that may execute this activity if available. Null otherwise

setModificationType

public void setModificationType(HighLevelDataAttribute att,
                                HLTransition.ModificationType modType)
Sets the modification type for the specified data attribute. Note that if the data attribute already has been defined for this HLTransition that the modification type will be overwritten.

Parameters:
att - HighLevelDataAttribute the data attribute for which we want to define the modification type
modType - ModificationType the modification type for the data attribute

getModificationTypeForDataAttribute

public HLTransition.ModificationType getModificationTypeForDataAttribute(HighLevelDataAttribute att)
Retrieves for the specified data attribute its modification type

Parameters:
att - HighLevelDataAttribute the data attribute for which we want to obtain its modification type
Returns:
ModificationType the modification type for the data attribute or null if the data attribute is not defined for this HLTransition

updateGUI

public void updateGUI()
Description copied from interface: GuiNotificationTarget
This method will be called as soon as the associated GUI property has changed.
Using this callback technique the reaction to changes of the GUI property becomes possible in a decoupled way.

Specified by:
updateGUI in interface GuiNotificationTarget

getPanel

public javax.swing.JPanel getPanel()
Description copied from interface: GuiDisplayable
Retrieves the GUI panel representing this object.

Specified by:
getPanel in interface GuiDisplayable
Returns:
the GUI panel representing this object

removeAllDataAttributes

public void removeAllDataAttributes()
Remove all data attributes from this transition.

Specified by:
removeAllDataAttributes in interface HighLevelActivity

existsDataDependency

public void existsDataDependency(boolean dep)
Indicate whether a data dependency exists for this transition

Parameters:
dep - boolean true if yes, false otherwise

hasDataDependency

public boolean hasDataDependency()
Retrieves whether a data dependency exists for this transition

Returns:
boolean true if a data dependency exists, false otherwise

existsProbabilityDependency

public void existsProbabilityDependency(boolean dep)
Indicate whether a possibility dependency exists for this transition

Parameters:
dep - boolean true if yes, false otherwise

hasProbabilityDependency

public boolean hasProbabilityDependency()
Retrieves whether a probability dependency exists for this transition

Returns:
boolean true if a probability dependency exists, false otherwise

getFrequencyPanel

public javax.swing.JPanel getFrequencyPanel()
A panel representing this activity as a frequency dependency.

Returns:
the GUI panel representing this frequency dependency

toString

public java.lang.String toString()
Returns the name of this high level transtion.

Specified by:
toString in interface HighLevelActivity
Overrides:
toString in class java.lang.Object
Returns:
the name of this high level transition

removeGroup

public boolean removeGroup(HighLevelGroup grp)
Removes the given group from this activity.

Specified by:
removeGroup in interface HighLevelActivity
Parameters:
grp - the group to be removed
Returns:
true if the group was found and removed, false otherwise

removeGroup

public void removeGroup()
Removes the group from this activity.


equals

public boolean equals(java.lang.Object obj)
Description copied from interface: HighLevelActivity
Determines when two highLevelActivities are the same. Two highLevelActivities are the same when the following items are the same for the two highLevelActivities:

Specified by:
equals in interface HighLevelActivity
Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean

hashCode

public int hashCode()
Description copied from interface: HighLevelActivity
Retrieves the hashcode for the object. The hashcode value for a HighLevelActivity object is calculated according to the recipe of Josha Bloch in Effective Java (Addison-Wesley 2001). For this recipe the following items have to be considered:

Specified by:
hashCode in interface HighLevelActivity
Overrides:
hashCode in class java.lang.Object
Returns:
int the hashcode value for the HighLevelActivity object.