IOPort weightPort = (IOPort) weightPorts.next();
if (!temporaryDestinationPortList.contains(weightPort)) {
temporaryDestinationPortList.add(weightPort);
Nameable weightPlace = weightPort.getContainer();
if (weightPlace instanceof PetriNetActor) {
if (weightPort.isOutput()) {
newRelationList.addAll(weightPort
.linkedRelationList());
} else if (weightPort.isInput()) {
newRelationList.addAll(weightPort
.insideRelationList());
}
} else if (weightPlace instanceof Place) {
// Don't do anything for Place
} else {
_debug("something wrong "
+ weightPlace.getFullName());
}
}
}
int weightNumber = _getWeightNumber(weights);
LinkedList forwardConnectedPlaces = _findForwardConnectedPlaces(weights);
Iterator forwardConnectedPlace = forwardConnectedPlaces
.iterator();
int itemCount = 0;
while (forwardConnectedPlace.hasNext()) {
Place forwardPlace = (Place) forwardConnectedPlace.next();
itemCount++;
int oldToken = forwardPlace.getMarking();
forwardPlace.increaseMarking(weightNumber);
if (_debugging) {
_debug(" the " + itemCount + " place is "
+ forwardPlace.getFullName() + " old "
+ oldToken + " new "
+ forwardPlace.getMarking());
}
}
}
newRelationList.remove(weights);
}
LinkedList backRelationList = new LinkedList();
Iterator inputPorts = transition.inputPortList().iterator();
while (inputPorts.hasNext()) {
IOPort inPort = (IOPort) inputPorts.next();
backRelationList.addAll(inPort.linkedRelationList());
}
LinkedList temporarySourcePortList = new LinkedList();
while (backRelationList.size() > 0) {
IORelation weights = (IORelation) backRelationList.getFirst();
if (weights != null) {
Iterator weightPorts = weights.linkedSourcePortList()
.iterator();
while (weightPorts.hasNext()) {
IOPort weightPort = (IOPort) weightPorts.next();
if (!temporarySourcePortList.contains(weightPort)) {
temporarySourcePortList.add(weightPort);
Nameable weightPlace = weightPort.getContainer();
if (weightPlace instanceof PetriNetActor) {
if (weightPort.isOutput()) {
backRelationList.addAll(weightPort
.insideRelationList());