org.processmining.exporting.petrinet.cpnexport
Class HLToCPNTranslator

java.lang.Object
  extended by org.processmining.exporting.petrinet.cpnexport.HLToCPNTranslator

public class HLToCPNTranslator
extends java.lang.Object

Translates the high-level information to the CPN-specific Petri net that can be immedeately written to a .cpn file.

Author:
arozinat, rmans

Field Summary
static java.lang.String cpnColorSetNameForCaseId
           
static java.lang.String cpnColorSetNameForDataAttributes
           
static java.lang.String cpnColorSetNameForGroupAllResources
           
static java.lang.String cpnColorSetNameForGroupAllResourcesWithNobody
           
static java.lang.String cpnColorSetNameForNobodyGroup
           
static java.lang.String cpnColorSetNameForProbDep
           
static java.lang.String cpnColorSetNameForStartCase
           
static java.lang.String cpnVarNameForCaseId
           
static java.lang.String cpnVarNameForDataAttributes
           
static java.lang.String cpnVarNameForGroupAllResources
           
static java.lang.String cpnVarNameForGroupAllResourcesWithNobody
           
static java.lang.String cpnVarNameForModifiedDataAttributes
           
static java.lang.String cpnVarNameForNobodyGroup
           
static java.lang.String cpnVarNameForProbDep
           
static java.lang.String cpnVarNameForStartCase
           
 
Constructor Summary
HLToCPNTranslator(HLPetriNet hlPN, ColoredPetriNet simPN)
          Default constructor
 
Method Summary
 org.processmining.exporting.petrinet.cpnexport.CpnFunction generateRandomFunctionForDataAttribute(HighLevelDataAttribute dataAttr)
          Returns the declaration of a function that can be used in cpn for generating random values (between some range) for the given data attribute.
 IntegerColorSet getColorSetCaseID()
          Returns the cpn color set representation for the case id.
 CpnColorSet getColorSetDataAttribute(HighLevelDataAttribute attrib)
          Returns the cpn color set representation for this data attribute
 CpnColorSet getColorSetDataAttributes()
          Returns the cpn color set representation for the color set in cpn that has to represent all separate data attributes
 SubSetColorSet getColorSetForResourcesPlace()
          Returns the cpn color set representation that has to be assigned to the resources places in the cpn net.
 SubSetColorSet getColorSetGroup(HighLevelGroup g)
          Returns the corresponding cpn color set representation for the given group
 java.util.ArrayList<SubSetColorSet> getColorSetsGroups()
          Returns the cpn color set representation for all groups that can be found in the highlevelprocess and in the highlevelactivities
 java.util.ArrayList<CpnColorSet> getColorSetsSeparateDataAttributes()
          Return the corresponding cpn color set representation for each separate data attribute that can be found in the high level process and the high level activities
 StringColorSet getColorSetStartCase()
          Returns the cpn color set representation for the start case.
 java.lang.String getCpnIdMonitorTroughputTime()
          Retrieves the cpn id of the transition to which the monitor is attached that calculates the throughput time for each case
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForCaseId()
          Returns the cpn variable and type for the variable that has to represent \ the case id in cpn.
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForDataAttribute(HighLevelDataAttribute attrib)
          Returns the cpn variable and type for the variable that has to represent the given data attribute
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForDataAttributes()
          Returns the cpn variable and type that has to represent the variable for the data attributes in cpn
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForGroup(HighLevelGroup g)
          Returns the cpn variable and type for the given group
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForGroupAllResources()
          Returns the cpn variable and type for the variable in cpn that has to represent the group that contains each resource that can be found in the high level process and each high level activity
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForModifiedDataAttributes()
          Returns the cpn variable and type that has to represent the variable for the modified data attributes in cpn
 org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForStartCase()
          Returns the cpn variable and type for the variable that has to represent the start time stamp of a case
 java.util.ArrayList<org.processmining.exporting.petrinet.cpnexport.CpnVarAndType> getCpnVarsForGroups()
          Returns a list with the cpn vars for all groups, except the cpn-var that has to represent all resources.
 java.util.HashSet<org.processmining.exporting.petrinet.cpnexport.CpnVarAndType> getCpnVarsForProbDep()
          Returns the cpn variables for the probability variables
 java.util.ArrayList<HLDataDependency> getDataDependenciesForTargetNode(ModelGraphVertex n)
          Returns a list of data dependencies for which node n is the target node in these data dependencies
protected  ColoredTransition getFirstTransitionOnSubpage_Resource(ColoredPetriNet subpage)
          Returns the first start transition on the subpage.
protected  ColoredTransition getFirstTransitionOnSubpage(ColoredPetriNet subpage)
          Returns the first transition on the subpage.
 java.util.HashMap getFusionPlaces()
          Returns the fusion that are needed when generating the subpage
 java.util.HashMap<java.lang.String,java.util.ArrayList> getInfoForMonitoringResources()
          Returns the information that is needed for generating the monitor that keeps track of the resources that are available in the resources place
protected  ColoredTransition getLastTransitionOnSubpage(ColoredPetriNet subpage)
          Returns the last transition on the subpage.
 java.util.ArrayList<java.lang.String> getPageinstancesMonitorThroughputTime()
          Retrieves the pageinstance idrefs of the page on which the transition is located which monitor calculates the throughput time for each case
 java.util.Set<ProductColorSet> getProductColorSetsForPlaces()
          Returns all the product color sets that has been produced by ProductCpnColorSet
 ProductColorSet productCpnColorSet(java.util.ArrayList<CpnColorSet> cSets)
          Returns the product of two or more cpn color sets.
 ColoredPetriNet translate()
          Translate the simulation model to a cpn model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cpnVarNameForCaseId

public static final java.lang.String cpnVarNameForCaseId
See Also:
Constant Field Values

cpnColorSetNameForCaseId

public static final java.lang.String cpnColorSetNameForCaseId
See Also:
Constant Field Values

cpnVarNameForStartCase

public static final java.lang.String cpnVarNameForStartCase
See Also:
Constant Field Values

cpnColorSetNameForStartCase

public static final java.lang.String cpnColorSetNameForStartCase
See Also:
Constant Field Values

cpnVarNameForDataAttributes

public static final java.lang.String cpnVarNameForDataAttributes
See Also:
Constant Field Values

cpnVarNameForModifiedDataAttributes

public static final java.lang.String cpnVarNameForModifiedDataAttributes
See Also:
Constant Field Values

cpnColorSetNameForDataAttributes

public static final java.lang.String cpnColorSetNameForDataAttributes
See Also:
Constant Field Values

cpnVarNameForGroupAllResources

public static final java.lang.String cpnVarNameForGroupAllResources
See Also:
Constant Field Values

cpnColorSetNameForGroupAllResources

public static final java.lang.String cpnColorSetNameForGroupAllResources
See Also:
Constant Field Values

cpnVarNameForGroupAllResourcesWithNobody

public static final java.lang.String cpnVarNameForGroupAllResourcesWithNobody
See Also:
Constant Field Values

cpnColorSetNameForGroupAllResourcesWithNobody

public static final java.lang.String cpnColorSetNameForGroupAllResourcesWithNobody
See Also:
Constant Field Values

cpnVarNameForNobodyGroup

public static final java.lang.String cpnVarNameForNobodyGroup
See Also:
Constant Field Values

cpnColorSetNameForNobodyGroup

public static final java.lang.String cpnColorSetNameForNobodyGroup
See Also:
Constant Field Values

cpnVarNameForProbDep

public static final java.lang.String cpnVarNameForProbDep
See Also:
Constant Field Values

cpnColorSetNameForProbDep

public static final java.lang.String cpnColorSetNameForProbDep
See Also:
Constant Field Values
Constructor Detail

HLToCPNTranslator

public HLToCPNTranslator(HLPetriNet hlPN,
                         ColoredPetriNet simPN)
Default constructor

Parameters:
hlPN - the PetriNet-based simulation model
simPN - the ordinary colored petri net
Method Detail

getFusionPlaces

public java.util.HashMap getFusionPlaces()
Returns the fusion that are needed when generating the subpage

Returns:
HashMap the fusionplaces

getCpnIdMonitorTroughputTime

public java.lang.String getCpnIdMonitorTroughputTime()
Retrieves the cpn id of the transition to which the monitor is attached that calculates the throughput time for each case

Returns:
String

getPageinstancesMonitorThroughputTime

public java.util.ArrayList<java.lang.String> getPageinstancesMonitorThroughputTime()
Retrieves the pageinstance idrefs of the page on which the transition is located which monitor calculates the throughput time for each case

Returns:
ArrayList the pageinstanceidrefs

getColorSetGroup

public SubSetColorSet getColorSetGroup(HighLevelGroup g)
Returns the corresponding cpn color set representation for the given group

Parameters:
g - Group the group for which we want to obtain the corresponding cpn color set representation
Returns:
CpnColorSet the corresponding cpn color set representation

getColorSetsGroups

public java.util.ArrayList<SubSetColorSet> getColorSetsGroups()
Returns the cpn color set representation for all groups that can be found in the highlevelprocess and in the highlevelactivities

Returns:
ArrayList the cpn color representations for all groups. If no groups exists, then an empty ArrayList is returned

getColorSetDataAttributes

public CpnColorSet getColorSetDataAttributes()
Returns the cpn color set representation for the color set in cpn that has to represent all separate data attributes

Returns:
CpnColorSet the cpn color set representation for the data types that represents all separate data attributes. If no data attibutes exist in the process, null is returned

getColorSetDataAttribute

public CpnColorSet getColorSetDataAttribute(HighLevelDataAttribute attrib)
Returns the cpn color set representation for this data attribute

Parameters:
attrib - HLAttribute the data attribute for which we want to obtain the cpn color set
Returns:
CpnColorSet the color set representation for this data attribute.

getColorSetsSeparateDataAttributes

public java.util.ArrayList<CpnColorSet> getColorSetsSeparateDataAttributes()
Return the corresponding cpn color set representation for each separate data attribute that can be found in the high level process and the high level activities

Returns:
ArrayList the cpn color representations for each separate data attributes. If no data attributes exist, an empty ArrayList is returned

getColorSetCaseID

public IntegerColorSet getColorSetCaseID()
Returns the cpn color set representation for the case id.

Returns:
CpnColorSet the cpn color set representation for the case id.

getColorSetStartCase

public StringColorSet getColorSetStartCase()
Returns the cpn color set representation for the start case.

Returns:
StringColorSet the cpn color set representation for the start case.

getColorSetForResourcesPlace

public SubSetColorSet getColorSetForResourcesPlace()
Returns the cpn color set representation that has to be assigned to the resources places in the cpn net.

Returns:
CpnColorSet the color set representation for all resources

getCpnVarForGroup

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForGroup(HighLevelGroup g)
Returns the cpn variable and type for the given group

Parameters:
g - Group the group for which we want to obtain the cpn variable and type
Returns:
CpnVarAndType the cpn variable and type for the given group

getCpnVarForDataAttributes

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForDataAttributes()
Returns the cpn variable and type that has to represent the variable for the data attributes in cpn

Returns:
CpnVarAndType the variable in cpn for the data attributes

getCpnVarForModifiedDataAttributes

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForModifiedDataAttributes()
Returns the cpn variable and type that has to represent the variable for the modified data attributes in cpn

Returns:
CpnVarAndType the variable in cpn for the modified data attributes

getCpnVarForDataAttribute

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForDataAttribute(HighLevelDataAttribute attrib)
Returns the cpn variable and type for the variable that has to represent the given data attribute

Parameters:
attrib - HighLevelDataAttribute the data attribute for which we want to obtain a cpn compliant variable
Returns:
CpnVarAndType the variable and type in cpn for the given data attribute

getCpnVarForCaseId

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForCaseId()
Returns the cpn variable and type for the variable that has to represent \ the case id in cpn.

Returns:
CpnVarAndType the cpn variable and type for the case id

getCpnVarForStartCase

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForStartCase()
Returns the cpn variable and type for the variable that has to represent the start time stamp of a case

Returns:
CpnVarAndType the cpn variable and type for the start case

getCpnVarsForProbDep

public java.util.HashSet<org.processmining.exporting.petrinet.cpnexport.CpnVarAndType> getCpnVarsForProbDep()
Returns the cpn variables for the probability variables

Returns:
HashSet

getCpnVarForGroupAllResources

public org.processmining.exporting.petrinet.cpnexport.CpnVarAndType getCpnVarForGroupAllResources()
Returns the cpn variable and type for the variable in cpn that has to represent the group that contains each resource that can be found in the high level process and each high level activity

Returns:
CpnVarAndType the cpn variable and type for the group that contains each resource

getCpnVarsForGroups

public java.util.ArrayList<org.processmining.exporting.petrinet.cpnexport.CpnVarAndType> getCpnVarsForGroups()
Returns a list with the cpn vars for all groups, except the cpn-var that has to represent all resources.

Returns:
ArrayList

productCpnColorSet

public ProductColorSet productCpnColorSet(java.util.ArrayList<CpnColorSet> cSets)
Returns the product of two or more cpn color sets. In case that the ColoredPetriNet is written to a cpn-file the color set (that is the product of two or more cpn color sets) will occur as a color set in this file

Parameters:
cSets - ArrayList the color sets for which we want to obtain the color that is the product of them
Returns:
CpnColorSet the color set which is the product of two or more color sets

getProductColorSetsForPlaces

public java.util.Set<ProductColorSet> getProductColorSetsForPlaces()
Returns all the product color sets that has been produced by ProductCpnColorSet

Returns:
Set a set with product color sets
See Also:
ProductCpnColorSet

generateRandomFunctionForDataAttribute

public org.processmining.exporting.petrinet.cpnexport.CpnFunction generateRandomFunctionForDataAttribute(HighLevelDataAttribute dataAttr)
Returns the declaration of a function that can be used in cpn for generating random values (between some range) for the given data attribute.

Parameters:
dataAttr - HighLevelDataAttribute the data attribute for which we want to obtain a function that generates random values between some range
Returns:
CpnFunction a declaration of a function that generates random values

translate

public ColoredPetriNet translate()
Translate the simulation model to a cpn model

Returns:
a petri net that is close to cpn and can be immediately exported to cpn.

getDataDependenciesForTargetNode

public java.util.ArrayList<HLDataDependency> getDataDependenciesForTargetNode(ModelGraphVertex n)
Returns a list of data dependencies for which node n is the target node in these data dependencies

Parameters:
n - ModelGraphVertex the node that has to be target node of a data dependency
Returns:
ArrayList a list with data dependencies for which node n is the target node of these data dependencies

getFirstTransitionOnSubpage

protected ColoredTransition getFirstTransitionOnSubpage(ColoredPetriNet subpage)
Returns the first transition on the subpage. The first transitions does either have the schedule, start or complete eventtype

Parameters:
subpage - ColoredPetriNet
Returns:
ColoredTransition

getFirstTransitionOnSubpage_Resource

protected ColoredTransition getFirstTransitionOnSubpage_Resource(ColoredPetriNet subpage)
Returns the first start transition on the subpage. Since the resource can not be assigen to schedule event, the first transitions does either have the start or complete eventtype

Parameters:
subpage - ColoredPetriNet
Returns:
ColoredTransition

getLastTransitionOnSubpage

protected ColoredTransition getLastTransitionOnSubpage(ColoredPetriNet subpage)
Returns the last transition on the subpage. The last transition on the subpage does always have the complete eventtype which always exists

Parameters:
subpage - ColoredPetriNet
Returns:
ColoredTransition

getInfoForMonitoringResources

public java.util.HashMap<java.lang.String,java.util.ArrayList> getInfoForMonitoringResources()
Returns the information that is needed for generating the monitor that keeps track of the resources that are available in the resources place

Returns:
HashMap