Class PetrinetGraphConnection
- java.lang.Object
-
- org.processmining.framework.connections.impl.AbstractConnection
-
- org.processmining.models.connections.petrinets.PetrinetGraphConnection
-
- All Implemented Interfaces:
org.processmining.framework.connections.Connection
public class PetrinetGraphConnection extends org.processmining.framework.connections.impl.AbstractConnection
-
-
Constructor Summary
Constructors Constructor Description PetrinetGraphConnection(PetrinetGraph source, PetrinetGraph target, java.util.Map<Transition,Transition> transitionMap, java.util.Map<Place,Place> placeMap)Connects the two Petri nets through the mappings described in the transitions and place map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<Place,Place>getPlaceMapping()Returns the mapping from places in source to places in targetjava.util.Map<Transition,Transition>getTransitionMapping()Returns the mapping from transitions in source to transitions in targetbooleanisSourceNet(PetrinetGraph net)return true if this net is the source of the connection.booleanisTargetNet(PetrinetGraph net)return true if this net is the source of the connection.
-
-
-
Field Detail
-
SOURCE
public static final java.lang.String SOURCE
- See Also:
- Constant Field Values
-
TARGET
public static final java.lang.String TARGET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PetrinetGraphConnection
public PetrinetGraphConnection(PetrinetGraph source, PetrinetGraph target, java.util.Map<Transition,Transition> transitionMap, java.util.Map<Place,Place> placeMap)
Connects the two Petri nets through the mappings described in the transitions and place map. The following assumptions are made: assert(source.getTransitions().containsAll(transitionMap.keySet())); assert(target.getTransitions().containsAll(transitionMap.values())); assert(source.getPlaces().containsAll(placeMap.keySet())); assert(target.getPlaces().containsAll(placeMap.values()));- Parameters:
source- the source Petri nettarget- the target Petri nettransitionMap- the mapping between transitions. This mapping is copied as a WeakKeyValueMap to avoid keeping the net alive for the sake of storing the connection. This is necessary since Transitions keep pointers to the Petrinet in which they are contained and these nets are used in the connection.placeMap- the mapping between places. This mapping is copied as a WeakKeyValueMap to avoid keeping the net alive for the sake of storing the connection.
-
-
Method Detail
-
isSourceNet
public boolean isSourceNet(PetrinetGraph net)
return true if this net is the source of the connection. Note that any user has a reference to the net available when the connection is retrieved from the framework. No equals method is used, i.e. pointers are compared.- Parameters:
net-- Returns:
-
isTargetNet
public boolean isTargetNet(PetrinetGraph net)
return true if this net is the source of the connection. Note that any user has a reference to the net available when the connection is retrieved from the framework. No equals method is used, i.e. pointers are compared.- Parameters:
net-- Returns:
-
getTransitionMapping
public java.util.Map<Transition,Transition> getTransitionMapping()
Returns the mapping from transitions in source to transitions in target- Returns:
-
-