Class PlaceUtils
- java.lang.Object
-
- org.processmining.placebasedlpmdiscovery.utils.PlaceUtils
-
public class PlaceUtils extends java.lang.ObjectUtility functions that can be used over places
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPlaceUtils.Mapper
-
Constructor Summary
Constructors Constructor Description PlaceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublecomputePlaceMatchingCost(Place p1, Place p2)Computes the place matching cost such that the overlap between the input transition labels and output transition labels between the two places is measured and then combined with an equal weight.static org.processmining.models.graphbased.directed.petrinet.PetrinetextractPetriNet(java.lang.String petriNetFileName)static java.util.Set<Place>extractPlaceNets(java.lang.String placeNetsInputFilePath)static java.util.Set<Transition>getAllTransitions(java.util.Set<Place> places)static TransitiongetCommonSilentTransition(Place first, Place second)static <T> java.util.Map<org.apache.commons.math3.util.Pair<T,T>,java.util.Set<Place>>getInoutTransitionPlaceSetMapping(java.util.Set<Place> places, java.util.Map<java.lang.String,T> labelMap)Returns a map where every pair of input output transitions in the places is mapped to all places that have the same input output transition pairstatic java.util.Map<org.apache.commons.math3.util.Pair<java.lang.Integer,java.lang.Integer>,java.util.Set<java.util.List<Place>>>getInoutTransitionPlaceSetMappingViaSilent(java.util.Set<Place> places, java.util.Map<java.lang.String,java.lang.Integer> labelMap)static java.util.Set<Passage>getPassages(Place place)static PlaceSetgetPlaceSetFromInputStream(java.io.InputStream input)static java.util.Set<Place>getPlacesFromPetriNet(org.processmining.models.graphbased.directed.petrinet.Petrinet petrinet)static <T> java.util.Map<T,java.util.Set<Place>>getTransitionPlaceSetMapping(java.util.Set<java.lang.String> transitionLabels, java.util.Set<Place> places, boolean transitionIsInput, java.util.Map<java.lang.String,T> labelMap, boolean ignoreSelfLoops)Returns a map where every transition is mapped to all the places that have it as input transition or all the places that have it as output transition depending on the inputstatic java.util.Set<org.apache.commons.math3.util.Pair<java.lang.String,java.lang.String>>getVisibleInoutPairsInPlace(Place place)Calculates the pairs of all combination of input and output transitions in a place.static java.util.Map<Place,java.lang.Integer>mapPlacesToIndices(java.util.Set<Place> places)static voidpostProcessSilentTransitions(java.util.Set<Place> places)static voidprint(java.util.Set<Place> places)static PlacerevertPlace(Place place)
-
-
-
Method Detail
-
print
public static void print(java.util.Set<Place> places)
-
getTransitionPlaceSetMapping
public static <T> java.util.Map<T,java.util.Set<Place>> getTransitionPlaceSetMapping(java.util.Set<java.lang.String> transitionLabels, java.util.Set<Place> places, boolean transitionIsInput, java.util.Map<java.lang.String,T> labelMap, boolean ignoreSelfLoops)
Returns a map where every transition is mapped to all the places that have it as input transition or all the places that have it as output transition depending on the input- Type Parameters:
T- : the type of the returning transition label- Parameters:
transitionLabels- : transition labels for which we want to create the mapplaces- : places for which we want to create the maptransitionIsInput- : whether we want to map the places for input or output transitionslabelMap- : map between the original transition labels and what we want to return- Returns:
- map of a transition label to set of places
-
getAllTransitions
public static java.util.Set<Transition> getAllTransitions(java.util.Set<Place> places)
-
getPlaceSetFromInputStream
public static PlaceSet getPlaceSetFromInputStream(java.io.InputStream input) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
getInoutTransitionPlaceSetMapping
public static <T> java.util.Map<org.apache.commons.math3.util.Pair<T,T>,java.util.Set<Place>> getInoutTransitionPlaceSetMapping(java.util.Set<Place> places, java.util.Map<java.lang.String,T> labelMap)
Returns a map where every pair of input output transitions in the places is mapped to all places that have the same input output transition pair- Type Parameters:
T- the new type of the transition labels- Parameters:
places- the places we want to grouplabelMap- the label mapping between the transitions in the places and the result we want to return- Returns:
- map from which we can get all places that have a specific input output transitions pair
-
postProcessSilentTransitions
public static void postProcessSilentTransitions(java.util.Set<Place> places)
-
getInoutTransitionPlaceSetMappingViaSilent
public static java.util.Map<org.apache.commons.math3.util.Pair<java.lang.Integer,java.lang.Integer>,java.util.Set<java.util.List<Place>>> getInoutTransitionPlaceSetMappingViaSilent(java.util.Set<Place> places, java.util.Map<java.lang.String,java.lang.Integer> labelMap)
-
getCommonSilentTransition
public static Transition getCommonSilentTransition(Place first, Place second)
-
getVisibleInoutPairsInPlace
public static java.util.Set<org.apache.commons.math3.util.Pair<java.lang.String,java.lang.String>> getVisibleInoutPairsInPlace(Place place)
Calculates the pairs of all combination of input and output transitions in a place.- Parameters:
place- : the place for which we want to calculate all combinations of input output transitions.- Returns:
- the pair of labels for all input output transition pairs
-
getPlacesFromPetriNet
public static java.util.Set<Place> getPlacesFromPetriNet(org.processmining.models.graphbased.directed.petrinet.Petrinet petrinet)
-
extractPlaceNets
public static java.util.Set<Place> extractPlaceNets(java.lang.String placeNetsInputFilePath) throws java.lang.Exception
- Throws:
java.lang.Exception
-
extractPetriNet
public static org.processmining.models.graphbased.directed.petrinet.Petrinet extractPetriNet(java.lang.String petriNetFileName) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException- Throws:
org.xmlpull.v1.XmlPullParserExceptionjava.io.IOException
-
computePlaceMatchingCost
public static double computePlaceMatchingCost(Place p1, Place p2)
Computes the place matching cost such that the overlap between the input transition labels and output transition labels between the two places is measured and then combined with an equal weight. Since this would denote how similar the two places are, we subtract the result from one to get a cost.- Parameters:
p1- the first placep2- the second place- Returns:
- the place matching cost
-
-