Skip to content

Commit b940b9f

Browse files
committed
fixed missed rerouter edges that are upstream of closed edges via different paths. fix #17707
1 parent f997918 commit b940b9f

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

tools/generateRerouters.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,29 +91,28 @@ def findNotifcationEdges(options, net, closedEdges):
9191
toCheck = list(unreachable.keys())
9292
while toCheck:
9393
cand = toCheck.pop(0)
94-
if cand in seen:
95-
continue
96-
seen.add(cand)
9794
for pred in cand.getIncoming().keys():
95+
if (cand, pred) in seen:
96+
continue
97+
seen.add((cand, pred))
9898
if pred.allows(options.vclass):
99-
if pred not in seen:
100-
reachable = net.getReachable(pred, options.vclass, cache=cache)
101-
found = unreachable[cand].intersection(reachable)
102-
pred_unreachable = set(unreachable[cand])
103-
pred_unreachable.difference_update(found)
104-
found.discard(pred)
105-
if found:
106-
#print(cand.getID(), pred.getID(), [e.getID() for e in found])
107-
result.add(pred)
108-
if pred_unreachable:
109-
unreachable[pred] = pred_unreachable
110-
toCheck.append(pred)
111-
else:
99+
reachable = net.getReachable(pred, options.vclass, cache=cache)
100+
found = unreachable[cand].intersection(reachable)
101+
pred_unreachable = set(unreachable[cand])
102+
pred_unreachable.difference_update(found)
103+
found.discard(pred)
104+
if found:
105+
#print(cand.getID(), pred.getID(), [e.getID() for e in found])
106+
result.add(pred)
107+
if pred_unreachable:
112108
unreachable[pred] = pred_unreachable
113109
toCheck.append(pred)
114-
if options.terminate and cand in closedEdges:
115-
#print(cand.getID(), pred.getID(), "terminate")
116-
result.add(pred)
110+
else:
111+
unreachable[pred] = pred_unreachable
112+
toCheck.append(pred)
113+
if options.terminate and cand in closedEdges:
114+
#print(cand.getID(), pred.getID(), "terminate")
115+
result.add(pred)
117116
return result
118117

119118

0 commit comments

Comments
 (0)