org.processmining.models.connections.petrinets
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
Field Summary |
static java.lang.String |
SOURCE
|
static java.lang.String |
TARGET
|
Fields inherited from class org.processmining.framework.connections.impl.AbstractConnection |
manager |
Methods inherited from class org.processmining.framework.connections.impl.AbstractConnection |
containsObjects, containsObjects, equals, get, getID, getLabel, getMapping, getObjects, getObjectWithRole, getRoles, hashCode, isRemoved, put, remove, remove, setLabel, setManager, toString, updated |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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
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.
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:
getPlaceMapping
public java.util.Map<Place,Place> getPlaceMapping()
- Returns the mapping from places in source to places in target
- Returns: