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

java.lang.Object
  extended by org.processmining.exporting.petrinet.cpnexport.HLImplementation.HLActivitySet
All Implemented Interfaces:
java.lang.Cloneable, HighLevelProcess

public class HLActivitySet
extends java.lang.Object
implements HighLevelProcess

This implementation of the HighLevelProcess interface is intended to serve as a bag for HighLevelActivities that cannot be related to a concrete process model.
The underlying process may be analyzed via some log analysis, but there is no process model at hand. An example for such analysis is the organizational miner, which discovers roles and groups of people, and finds out which activity is typically executed by which kind of people.
So, simulation information can be attached to the individual activities, and also global properties of the process analyzed can be described. However, simulation information relating to parts in the process model (e.g., choices) are not available, just like the underlying process model itself.

Author:
arozinat, rmans

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.processmining.framework.models.hlprocess.HighLevelProcess
HighLevelProcess.Perspective, HighLevelProcess.TimeUnit
 
Constructor Summary
HLActivitySet()
          Basic constructor
 
Method Summary
 void addActivity(HLActivity act)
          Adds a new HLActivity to the activity set
 void addChoice(HighLevelChoice choice)
          Adds a new choice construct to this high level petri process.
 boolean addDataAttribute(HighLevelDataAttribute att)
          Adds a new data attribute to this process.
 void addDataDependency(HighLevelDataDependency expression)
          Adds a data dependency to this process.
 boolean addGroup(HighLevelGroup grp)
          Adds a group to this process.
 HighLevelGroup addGroup(java.lang.String name)
          Creates a new group for this process.
 void addPerspective(HighLevelProcess.Perspective perspective)
          Adds a perspective that is covered by this simulation model
 void addProbabilityDependency(HighLevelProbabilityDependency prob)
          Add a probability dependency to this process.
 boolean addResource(HighLevelResource res)
          Adds a new resource to this process.
 HighLevelResource addResource(java.lang.String name)
          Creates a new resource for this process.
 boolean addResourceToGroup(HighLevelGroup group, HighLevelResource resource)
          Adds the given resource to the given group.
 java.lang.Object clone()
          Makes a deep copy of the object, i.e., reconstructs the HLActivitySet structure with cloned hlactivities.
 HLActivitySet cloneWithDefaultSimulationInformation()
          Clones the highlevelprocess in which the underlying process model is the same, but that the highlevelactivities and the highlevelchoices are cloned.
 ActivityVertex findActivityVertex(HLActivity hlActivity)
          Find the corresponding activityVertex in the process model.
 HighLevelActivity findHighLevelActivity(ModelGraphVertex v)
          Returns the HighLevelActivity object belonging to the given transition.
 ModelGraphVertex findModelGraphVertex(HighLevelActivity act)
          Returns the ModelGraphVertex in the graph that corresponds to the given highlevelactivity
 Distribution getCaseGenerationScheme()
          Retrieves the case arrival distribution for this process.
 java.util.List<HighLevelChoice> getChoices()
          Retrieves the list of HighLevelChoices contained in this process.
 java.util.Set<HighLevelDataAttribute> getDataAttributes()
          Retrieves the list of data attributes available for this process.
 java.util.List<HighLevelDataDependency> getDataDependencies()
          Retrieves the data dependencies specified for this process.
 java.util.List<ModelGraphVertex> getGraphNodes()
          Retrieves the nodes of the process model that belongs to the highlevel process
 HighLevelGroup getGroup(java.lang.String name)
           
 java.util.List<HighLevelGroup> getGroups()
          Retrieves the list of groups available for this process.
 java.util.List<HighLevelActivity> getHighLevelActivities()
          Retrieves the high level activities for this process.
 java.lang.String getName()
          Retrieves the name of this highlevelprocess.
 java.util.Set<HighLevelProcess.Perspective> getPerspectives()
          Retrieves the set of perspectives that is covered by this HighLevelProcess
 java.util.List<HighLevelProbabilityDependency> getProbabilityDependencies()
          Retrieves the probability dependencies specified for this process.
 ModelGraph getProcessModel()
           
 HighLevelResource getResource(java.lang.String name)
           
 java.util.Set<HighLevelResource> getResources()
          Retrieves the list of resources available for this process.
 HighLevelProcess.TimeUnit getTimeUnit()
          Retrieves the unit in which all the provided information related to time can be interpreted.
 javax.swing.JPanel getVisualization(java.util.Set<HighLevelProcess.Perspective> perspectivesToShow)
          Creates a visualization of the simulation model for the given perspectives.
 int getYearOffset()
          Retrieves the year offset that is used for logging.
 void removeActivity(HLActivity act)
          Removes the provided HLActivity from the activity set
 void removeAllDataAttributes()
          Removes all data attributes from this process
 void removeAllGroups()
          Remove all groups.
 void removeAllResources()
          Remove all resources.
 boolean removeChoice(HighLevelChoice choice)
          Removes the given choice from this process.
 boolean removeDataAttribute(HighLevelDataAttribute att)
          Removes the given data attribute from this process.
 boolean removeGroup(HighLevelGroup grp)
          Removes the given group from this process.
 boolean removeResource(HighLevelResource src)
          Removes the given resource from this process.
 boolean removeResourceFromGroup(HighLevelGroup group, HighLevelResource resource)
          Removes the given resource from the given group.
 void setCaseGenerationScheme(Distribution dist)
          Provides a case arrival distribution for this process.
 void setHighLevelActivity(ModelGraphVertex vertex, HighLevelActivity activity)
          Sets the corresponding highlevelactivity for a node of the process model that belongs to the highlevelprocess.
 void setName(java.lang.String name)
          Sets the name of the highlevelprocess
 void setTimeUnit(HighLevelProcess.TimeUnit unit)
          Specifies the unit in which all the provided information related to time can be interpreted.
 void setYearOffset(int offset)
          Sets the year offset that is used for logging.
 java.lang.String toString()
          Overrides the toString() method.
 void writeToTestLog()
          Writes the highlevelprocess to the test log.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.processmining.framework.models.hlprocess.HighLevelProcess
equals, hashCode
 

Constructor Detail

HLActivitySet

public HLActivitySet()
Basic constructor

Method Detail

addActivity

public void addActivity(HLActivity act)
Adds a new HLActivity to the activity set

Parameters:
act - HLActivity the highlevel activity to be added to the activity set

removeActivity

public void removeActivity(HLActivity act)
Removes the provided HLActivity from the activity set

Parameters:
act - HLActivity the hlactivity to be removed from the activity set

setName

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

Specified by:
setName in interface HighLevelProcess
Parameters:
name - String the name of the highlevelprocess

getName

public java.lang.String getName()
Description copied from interface: HighLevelProcess
Retrieves the name of this highlevelprocess.

Specified by:
getName in interface HighLevelProcess
Returns:
String the name of the highlevelprocess

toString

public java.lang.String toString()
Description copied from interface: HighLevelProcess
Overrides the toString() method. This method should return the same String as the method getName() returns. So, it should return the name of the highlevelprocess.

Specified by:
toString in interface HighLevelProcess
Overrides:
toString in class java.lang.Object
Returns:
String the name of the highlevelprocess.

findHighLevelActivity

public HighLevelActivity findHighLevelActivity(ModelGraphVertex v)
Description copied from interface: HighLevelProcess
Returns the HighLevelActivity object belonging to the given transition.
Note that the given modelgraphvertex only needs to be equal to the modelgraphvertex of the belonging graph but not the same object.

Specified by:
findHighLevelActivity in interface HighLevelProcess
Parameters:
v - ModelGraphVertex the vertex for which the corresponding simulation information object is to be found
Returns:
HighLevelActivity the highlevel activity object for the given modelgraph vertex Null otherwise

findActivityVertex

public ActivityVertex findActivityVertex(HLActivity hlActivity)
Find the corresponding activityVertex in the process model.

Parameters:
hlActivity - HLActivity the HLActivity for which the corresponding activityVertex is to be found
Returns:
ActivityVertex the corresponding activityVertex in the ActivityGraph

findModelGraphVertex

public ModelGraphVertex findModelGraphVertex(HighLevelActivity act)
Description copied from interface: HighLevelProcess
Returns the ModelGraphVertex in the graph that corresponds to the given highlevelactivity

Specified by:
findModelGraphVertex in interface HighLevelProcess
Parameters:
act - HighLevelActivity the highlevelactivity for which we want to have the corresponding modelgraphVertex in the graph
Returns:
ModelGraphVertex the modelgraphvertex in the graph that corresponds to the given highlevelactivity

getGraphNodes

public java.util.List<ModelGraphVertex> getGraphNodes()
Description copied from interface: HighLevelProcess
Retrieves the nodes of the process model that belongs to the highlevel process

Specified by:
getGraphNodes in interface HighLevelProcess
Returns:
List the nodes of the process model that belongs to the highlevel process An empty list is returned if there are no nodes present in the process model

setHighLevelActivity

public void setHighLevelActivity(ModelGraphVertex vertex,
                                 HighLevelActivity activity)
Description copied from interface: HighLevelProcess
Sets the corresponding highlevelactivity for a node of the process model that belongs to the highlevelprocess.

If the vertex does not appear in the process model and also not corresponds to an activity, the method call should not have any effect.

Specified by:
setHighLevelActivity in interface HighLevelProcess
Parameters:
vertex - ModelGraphVertex a node in the process model that belongs to the highlevelprocess
activity - HighLevelActivity the highlevelactivity that has to be assigned to the node in the process model.

addChoice

public void addChoice(HighLevelChoice choice)
Description copied from interface: HighLevelProcess
Adds a new choice construct to this high level petri process.

Specified by:
addChoice in interface HighLevelProcess
Parameters:
choice - the new choice construct to be added

addDataAttribute

public boolean addDataAttribute(HighLevelDataAttribute att)
Description copied from interface: HighLevelProcess
Adds a new data attribute to this process.
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 HighLevelProcess
Parameters:
att - the attributed to be added
Returns:
True if the data attribute was not defined for this process already (it has been added), false otherwise (method call had no effect)

addDataDependency

public void addDataDependency(HighLevelDataDependency expression)
Description copied from interface: HighLevelProcess
Adds a data dependency to this process.
This relates to a constraint with respect to chosing the specified alternative branch in the model.
Note that if there is already another data dependency specified from the same source node to the same target node, this dependency will replace the old dependency.

Conflict: Note further that there is a semantic conflict between

Specified by:
addDataDependency in interface HighLevelProcess
Parameters:
expression - the data dependency to be added
See Also:
#addProbabilityDependency(ProbabilityDependency), HighLevelActivity#addFrequencyDependency(int)

addGroup

public boolean addGroup(HighLevelGroup grp)
Description copied from interface: HighLevelProcess
Adds a group to this process.
Note that a group can be any group of people, for example, having the same role. Note further that if a group of the same name exists already, it will be overwritten by this new group.

Specified by:
addGroup in interface HighLevelProcess
Parameters:
grp - HighLevelGroup the highlevel group
Returns:
True if the group was not defined for this process already (it has been added), false otherwise (method call had no effect)

addGroup

public HighLevelGroup addGroup(java.lang.String name)
Description copied from interface: HighLevelProcess
Creates a new group for this process.
Note that a group can be any group of people, for example, having the same role. Note further that if a group of the same name exists already, it will be overwritten by this new empty group.

Specified by:
addGroup in interface HighLevelProcess
Parameters:
name - the name of the group to be created
Returns:
the group object that has been added
See Also:
HighLevelProcess.getGroups(), #addResourceToGroup(), #removeResourceFromGroup()

addPerspective

public void addPerspective(HighLevelProcess.Perspective perspective)
Description copied from interface: HighLevelProcess
Adds a perspective that is covered by this simulation model

Specified by:
addPerspective in interface HighLevelProcess

addProbabilityDependency

public void addProbabilityDependency(HighLevelProbabilityDependency prob)
Description copied from interface: HighLevelProcess
Add a probability dependency to this process. This relates to the probability of chosing the specified alternative branch in the model.


Conflict: Note further that there is a semantic conflict

Specified by:
addProbabilityDependency in interface HighLevelProcess
Parameters:
prob - the probability dependency to be added
See Also:
#addDataDependency(DataDependency), HighLevelActivity#addFrequencyDependency(int)

addResource

public boolean addResource(HighLevelResource res)
Description copied from interface: HighLevelProcess
Adds a new resource to this process.
Note that if this resource had already been added to this process before, it will not be added again.

Specified by:
addResource in interface HighLevelProcess
Parameters:
res - the resource to be added
Returns:
True if the resource was not defined for this process already (it has been added), false otherwise (method call had no effect)

addResource

public HighLevelResource addResource(java.lang.String name)
Description copied from interface: HighLevelProcess
Creates a new resource for this process.
Note that if a resource of the same name exists already, it will be overwritten by this new resource.

Specified by:
addResource in interface HighLevelProcess
Returns:
the resource object that has been added

addResourceToGroup

public boolean addResourceToGroup(HighLevelGroup group,
                                  HighLevelResource resource)
Description copied from interface: HighLevelProcess
Adds the given resource to the given group.
Note that

Specified by:
addResourceToGroup in interface HighLevelProcess
Parameters:
group - the group to which the specified resource is to be added
resource - the resource to be added
Returns:
True if the resource was not part of this group already (it has been added). False otherwise (method call had no effect)
See Also:
HighLevelProcess.addGroup(String), HighLevelProcess.getGroups(), HighLevelProcess.removeResourceFromGroup(HighLevelGroup, HighLevelResource)

getCaseGenerationScheme

public Distribution getCaseGenerationScheme()
Description copied from interface: HighLevelProcess
Retrieves the case arrival distribution for this process.

Specified by:
getCaseGenerationScheme in interface HighLevelProcess
Returns:
the distribution of the process. If no case generation scheme has been set, a default distribution needs to be returned.

getYearOffset

public int getYearOffset()
Description copied from interface: HighLevelProcess
Retrieves the year offset that is used for logging.

Specified by:
getYearOffset in interface HighLevelProcess
Returns:
int the year offset used for logging.

getChoices

public java.util.List<HighLevelChoice> getChoices()
Description copied from interface: HighLevelProcess
Retrieves the list of HighLevelChoices contained in this process.

Specified by:
getChoices in interface HighLevelProcess
Returns:
a list of HighLevelChoices maintained by this high level petri net if available. An empty list is returned otherwise.

getDataAttributes

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

Note that this list should be consistent with (i.e. be a super set of) all the data attributes that have been added to contained activities.

Specified by:
getDataAttributes in interface HighLevelProcess
Returns:
the list of HighLevelDataAttribute objects representing the attributes defined for this process if available. An empty set is returned otherwise.

getDataDependencies

public java.util.List<HighLevelDataDependency> getDataDependencies()
Description copied from interface: HighLevelProcess
Retrieves the data dependencies specified for this process.

Conflict: Note that there is a semantic conflict between

Specified by:
getDataDependencies in interface HighLevelProcess
Returns:
the list of DataDependency objects representing the data dependencies provided for this process if available. An empty list will be returned otherwise.
See Also:
HighLevelProcess.getProbabilityDependencies(), HighLevelActivity.getFrequencyDependency()

getGroups

public java.util.List<HighLevelGroup> getGroups()
Description copied from interface: HighLevelProcess
Retrieves the list of groups available for this process.
Note that this list should be consistent with (i.e., be a super set of) all groups that

Specified by:
getGroups in interface HighLevelProcess
Returns:
the list of Group objects representing the groups defined for this process if available. An empty list is returned otherwise.

getGroup

public HighLevelGroup getGroup(java.lang.String name)

getHighLevelActivities

public java.util.List<HighLevelActivity> getHighLevelActivities()
Description copied from interface: HighLevelProcess
Retrieves the high level activities for this process.

Specified by:
getHighLevelActivities in interface HighLevelProcess
Returns:
the list of HighLevelActivity objects belonging to this process if available. An empty list will be returned otherwise.
See Also:
HighLevelProcess.getChoices()

getPerspectives

public java.util.Set<HighLevelProcess.Perspective> getPerspectives()
Description copied from interface: HighLevelProcess
Retrieves the set of perspectives that is covered by this HighLevelProcess

Specified by:
getPerspectives in interface HighLevelProcess
Returns:
Set the set of perspectives that are covered by the HighLevelProcess

getProbabilityDependencies

public java.util.List<HighLevelProbabilityDependency> getProbabilityDependencies()
Description copied from interface: HighLevelProcess
Retrieves the probability dependencies specified for this process.

Conflict: Note further that there is a semantic conflict between

Specified by:
getProbabilityDependencies in interface HighLevelProcess
Returns:
the list of ProbabilityDependency objects representing the probability dependencies provided for this process if available. An empty list will be returned otherwise.
See Also:
HighLevelProcess.getDataDependencies(), HighLevelActivity#getFrequencyDependencies()

getResources

public java.util.Set<HighLevelResource> getResources()
Description copied from interface: HighLevelProcess
Retrieves the list of resources available for this process.
Note that this list should be consistent with (i.e. be a super set of) all resources that

Specified by:
getResources in interface HighLevelProcess
Returns:
the list of Resource objects representing the resources defined for this process if available. An empty list will be returned otherwise.

getResource

public HighLevelResource getResource(java.lang.String name)

getTimeUnit

public HighLevelProcess.TimeUnit getTimeUnit()
Description copied from interface: HighLevelProcess
Retrieves the unit in which all the provided information related to time can be interpreted.

Specified by:
getTimeUnit in interface HighLevelProcess
Returns:
the time unit to be used for interpretation if available. Null otherwise
See Also:
#getCaseGenerationScheme(Distribution), HighLevelActivity.getExecutionTime(), HighLevelActivity.getWaitingTime(), HighLevelActivity.getSojournTime()

removeChoice

public boolean removeChoice(HighLevelChoice choice)
Description copied from interface: HighLevelProcess
Removes the given choice from this process.

Specified by:
removeChoice in interface HighLevelProcess
Returns:
true if the choice was found and removed, false otherwise

removeDataAttribute

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

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

removeAllDataAttributes

public void removeAllDataAttributes()
Description copied from interface: HighLevelProcess
Removes all data attributes from this process

Specified by:
removeAllDataAttributes in interface HighLevelProcess

removeGroup

public boolean removeGroup(HighLevelGroup grp)
Description copied from interface: HighLevelProcess
Removes the given group from this process.

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

removeAllGroups

public void removeAllGroups()
Description copied from interface: HighLevelProcess
Remove all groups.

Specified by:
removeAllGroups in interface HighLevelProcess

removeResource

public boolean removeResource(HighLevelResource src)
Description copied from interface: HighLevelProcess
Removes the given resource from this process.

Specified by:
removeResource in interface HighLevelProcess
Parameters:
src - the resource to be removed
Returns:
true if the resource was found and removed, false otherwise

removeAllResources

public void removeAllResources()
Description copied from interface: HighLevelProcess
Remove all resources.

Specified by:
removeAllResources in interface HighLevelProcess

removeResourceFromGroup

public boolean removeResourceFromGroup(HighLevelGroup group,
                                       HighLevelResource resource)
Description copied from interface: HighLevelProcess
Removes the given resource from the given group.
Note that if the group does not exist for this process, it will not be created.

Specified by:
removeResourceFromGroup in interface HighLevelProcess
Parameters:
group - the group to which the specified resource is to be removed
resource - the resource to be removed
Returns:
True if the group exists for this process and the resource was part of this group (it has been removed). False otherwise (method call had no effect)
See Also:
HighLevelProcess.addGroup(String), HighLevelProcess.getGroups(), HighLevelProcess.addResourceToGroup(HighLevelGroup, HighLevelResource)

setCaseGenerationScheme

public void setCaseGenerationScheme(Distribution dist)
Description copied from interface: HighLevelProcess
Provides a case arrival distribution for this process.

Specified by:
setCaseGenerationScheme in interface HighLevelProcess
Parameters:
dist - the distribution of the process

setTimeUnit

public void setTimeUnit(HighLevelProcess.TimeUnit unit)
Description copied from interface: HighLevelProcess
Specifies the unit in which all the provided information related to time can be interpreted.

Specified by:
setTimeUnit in interface HighLevelProcess
Parameters:
unit - the time unit to be used for interpretation
See Also:
#getCaseGenerationScheme(Distribution), HighLevelActivity.getExecutionTime(), HighLevelActivity.getWaitingTime(), HighLevelActivity.getSojournTime()

setYearOffset

public void setYearOffset(int offset)
Description copied from interface: HighLevelProcess
Sets the year offset that is used for logging. The generated logging monitors start to log at the Unix zero timestamp (i.e. 1970). With this method an year offset can be defined.

Specified by:
setYearOffset in interface HighLevelProcess
Parameters:
offset - int

clone

public java.lang.Object clone()
Makes a deep copy of the object, i.e., reconstructs the HLActivitySet structure with cloned hlactivities. Note that this method needs to be extended as soon as there are attributes added to the class which are not primitive or immutable.

Specified by:
clone in interface HighLevelProcess
Overrides:
clone in class java.lang.Object
Returns:
Object the cloned highlevelprocess

getVisualization

public javax.swing.JPanel getVisualization(java.util.Set<HighLevelProcess.Perspective> perspectivesToShow)
Description copied from interface: HighLevelProcess
Creates a visualization of the simulation model for the given perspectives.

Specified by:
getVisualization in interface HighLevelProcess
Parameters:
perspectivesToShow - List the perspectives that need to shown in the visualization of the simulation model.
Returns:
JPanel the visualization wrapped in a JPanel.

getProcessModel

public ModelGraph getProcessModel()

cloneWithDefaultSimulationInformation

public HLActivitySet cloneWithDefaultSimulationInformation()
Description copied from interface: HighLevelProcess
Clones the highlevelprocess in which the underlying process model is the same, but that the highlevelactivities and the highlevelchoices are cloned. However, the simulation information for the highlevelprocess, highlevelactivities and the highlevelchoices need to be default information. Also, the source and target nodes of the choices should not be cloned but point to nodes that are present in the process model (and which needs to remain the same).

Specified by:
cloneWithDefaultSimulationInformation in interface HighLevelProcess
Returns:
HighLevelProcess the cloned highlevelprocess which has the same underlying process model and with default simulation information for the highlevelprocess and the highlevelactivities.

writeToTestLog

public void writeToTestLog()
Description copied from interface: HighLevelProcess
Writes the highlevelprocess to the test log.

The following information (in exact order) should be written to the test log