org.processmining.framework.models.hlprocess
Interface HighLevelProcess

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
HLActivitySet, HLPetriNet

public interface HighLevelProcess
extends java.lang.Cloneable

Defines the data operations that are available for a high-level process.
Note that the interface specifies the maximum set of high-level information that can be provided for a process. However, some of these data represent a different view on the same thing, that is, they are in conflict with each other. This means that, although all the available information can be provided, eventually only a subset of it might be used (for example, based on the user's choice).
Note further that there is no need to provide all the information that can be specified via this interface. If for a specific concept no value is available, this simply means that it is "unknown".

Author:
arozinat, rmans
See Also:
HighLevelActivity, HighLevelChoice

Nested Class Summary
static class HighLevelProcess.Perspective
          Class representing a perspective that may be covered by the HighLevelProcess A HighLevelProcess model may cover more than one perspective.
static class HighLevelProcess.TimeUnit
          Class representing a time unit, such as "hour" or "millisecond".
 
Method Summary
 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()
          Clones the highlevelprocess.
 HighLevelProcess cloneWithDefaultSimulationInformation()
          Clones the highlevelprocess in which the underlying process model is the same, but that the highlevelactivities and the highlevelchoices are cloned.
 boolean equals(java.lang.Object obj)
          Determines when two highLevelProcesses are the same.
 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
 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.
 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.
 int hashCode()
          Retrieves the hashcode value for the object.
 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.
 

Method Detail

setName

void setName(java.lang.String name)
Sets the name of the highlevelprocess

Parameters:
name - String the name of the highlevelprocess

getName

java.lang.String getName()
Retrieves the name of this highlevelprocess.

Returns:
String the name of the highlevelprocess

toString

java.lang.String toString()
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.

Overrides:
toString in class java.lang.Object
Returns:
String the name of the highlevelprocess.

getHighLevelActivities

java.util.List<HighLevelActivity> getHighLevelActivities()
Retrieves the high level activities for this process.

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

getGraphNodes

java.util.List<ModelGraphVertex> getGraphNodes()
Retrieves the nodes of the process model that belongs to the highlevel process

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

void setHighLevelActivity(ModelGraphVertex vertex,
                          HighLevelActivity activity)
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.

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.

findHighLevelActivity

HighLevelActivity findHighLevelActivity(ModelGraphVertex v)
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.

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

findModelGraphVertex

ModelGraphVertex findModelGraphVertex(HighLevelActivity act)
Returns the ModelGraphVertex in the graph that corresponds to the given highlevelactivity

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

setTimeUnit

void setTimeUnit(HighLevelProcess.TimeUnit unit)
Specifies the unit in which all the provided information related to time can be interpreted.

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

getTimeUnit

HighLevelProcess.TimeUnit getTimeUnit()
Retrieves the unit in which all the provided information related to time can be interpreted.

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

setYearOffset

void setYearOffset(int offset)
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.

Parameters:
offset - int

getYearOffset

int getYearOffset()
Retrieves the year offset that is used for logging.

Returns:
int the year offset used for logging.

setCaseGenerationScheme

void setCaseGenerationScheme(Distribution dist)
Provides a case arrival distribution for this process.

Parameters:
dist - the distribution of the process

getCaseGenerationScheme

Distribution getCaseGenerationScheme()
Retrieves the case arrival distribution for this process.

Returns:
the distribution of the process. If no case generation scheme has been set, a default distribution needs to be returned.

addDataDependency

void addDataDependency(HighLevelDataDependency expression)
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

Parameters:
expression - the data dependency to be added
See Also:
#addProbabilityDependency(ProbabilityDependency), HighLevelActivity#addFrequencyDependency(int)

getDataDependencies

java.util.List<HighLevelDataDependency> getDataDependencies()
Retrieves the data dependencies specified for this process.

Conflict: Note that there is a semantic conflict between

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:
getProbabilityDependencies(), HighLevelActivity.getFrequencyDependency()

addProbabilityDependency

void addProbabilityDependency(HighLevelProbabilityDependency prob)
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

Parameters:
prob - the probability dependency to be added
See Also:
#addDataDependency(DataDependency), HighLevelActivity#addFrequencyDependency(int)

getProbabilityDependencies

java.util.List<HighLevelProbabilityDependency> getProbabilityDependencies()
Retrieves the probability dependencies specified for this process.

Conflict: Note further that there is a semantic conflict between

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:
getDataDependencies(), HighLevelActivity#getFrequencyDependencies()

addDataAttribute

boolean addDataAttribute(HighLevelDataAttribute att)
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.

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)

removeDataAttribute

boolean removeDataAttribute(HighLevelDataAttribute att)
Removes the given data attribute from this process.

Parameters:
att - the attribute to be removed
Returns:
true if the data attribute was found and removed, false otherwise

removeAllDataAttributes

void removeAllDataAttributes()
Removes all data attributes from this process


getDataAttributes

java.util.Set<HighLevelDataAttribute> getDataAttributes()
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.

Returns:
the list of HighLevelDataAttribute objects representing the attributes defined for this process if available. An empty set is returned otherwise.

addResource

HighLevelResource addResource(java.lang.String name)
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.

Parameters:
res - the resource to be added
Returns:
the resource object that has been added

addResource

boolean addResource(HighLevelResource res)
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.

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)

removeResource

boolean removeResource(HighLevelResource src)
Removes the given resource from this process.

Parameters:
src - the resource to be removed
Returns:
true if the resource was found and removed, false otherwise

removeAllResources

void removeAllResources()
Remove all resources.


getResources

java.util.Set<HighLevelResource> getResources()
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

Returns:
the list of Resource objects representing the resources defined for this process if available. An empty list will be returned otherwise.

addGroup

HighLevelGroup addGroup(java.lang.String name)
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.

Parameters:
name - the name of the group to be created
Returns:
the group object that has been added
See Also:
getGroups(), #addResourceToGroup(), #removeResourceFromGroup()

addGroup

boolean addGroup(HighLevelGroup grp)
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.

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)

removeGroup

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

Parameters:
grp - the group to be removed
Returns:
true if the group was found and removed, false otherwise

removeAllGroups

void removeAllGroups()
Remove all groups.


getGroups

java.util.List<HighLevelGroup> getGroups()
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

Returns:
the list of Group objects representing the groups defined for this process if available. An empty list is returned otherwise.

addResourceToGroup

boolean addResourceToGroup(HighLevelGroup group,
                           HighLevelResource resource)
Adds the given resource to the given group.
Note that

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:
addGroup(String), getGroups(), removeResourceFromGroup(HighLevelGroup, HighLevelResource)

removeResourceFromGroup

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

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:
addGroup(String), getGroups(), addResourceToGroup(HighLevelGroup, HighLevelResource)

addChoice

void addChoice(HighLevelChoice choice)
Adds a new choice construct to this high level petri process.

Parameters:
choice - the new choice construct to be added

getChoices

java.util.List<HighLevelChoice> getChoices()
Retrieves the list of HighLevelChoices contained in this process.

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

removeChoice

boolean removeChoice(HighLevelChoice choice)
Removes the given choice from this process.

Parameters:
grp - the choice to be removed
Returns:
true if the choice was found and removed, false otherwise

equals

boolean equals(java.lang.Object obj)
Determines when two highLevelProcesses are the same. Two highLevelProcesses are the same when the following items are the same for the two highLevelProcesses:

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object
Returns:
boolean

hashCode

int hashCode()
Retrieves the hashcode value for the object. The hashcode value for a HighLevelProcess 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:

Overrides:
hashCode in class java.lang.Object
Returns:
int the hashcode value for the HighLevelProcess object.

addPerspective

void addPerspective(HighLevelProcess.Perspective perspective)
Adds a perspective that is covered by this simulation model


getPerspectives

java.util.Set<HighLevelProcess.Perspective> getPerspectives()
Retrieves the set of perspectives that is covered by this HighLevelProcess

Returns:
Set the set of perspectives that are covered by the HighLevelProcess

clone

java.lang.Object clone()
Clones the highlevelprocess. This should be a deep copy instead of a shallow copy. A deep copy needs to be made of the highlevelprocess, the highlevelactivities and the highlevelchoices but the underlying process model may NOT be cloned. For the highlevelchoices this has as consequence that the source and target nodes may NOT be cloned but the other relevant information in these high level choices still needs to be cloned.

Returns:
Object the cloned highlevelprocess

cloneWithDefaultSimulationInformation

HighLevelProcess cloneWithDefaultSimulationInformation()
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).

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

getVisualization

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

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

writeToTestLog

void writeToTestLog()
Writes the highlevelprocess to the test log.

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