Skip to content

Commit e815320

Browse files
committed
fix grid scenario
1 parent 919a16c commit e815320

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

flow/scenarios/grid.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -527,19 +527,17 @@ def new_con(side, from_id, to_id, lane, signal_group):
527527

528528
# TODO necessary?
529529
def specify_edge_starts(self):
530-
"""See parent class.
531-
532-
Edges go in the following order: vert_right, vert_left, horz_right,
533-
horz_left.
534-
"""
530+
"""See parent class."""
535531
edgestarts = []
536532
for i in range(self.col_num + 1):
537533
for j in range(self.row_num + 1):
538534
index = "{}_{}".format(j, i)
539-
edgestarts += [("left" + index, 0 + i * 50 + j * 5000),
540-
("right" + index, 10 + i * 50 + j * 5000),
541-
("top" + index, 15 + i * 50 + j * 5000),
542-
("bot" + index, 20 + i * 50 + j * 5000)]
535+
if i != self.col_num:
536+
edgestarts += [("left" + index, 0 + i * 50 + j * 5000),
537+
("right" + index, 10 + i * 50 + j * 5000)]
538+
if j != self.row_num:
539+
edgestarts += [("top" + index, 15 + i * 50 + j * 5000),
540+
("bot" + index, 20 + i * 50 + j * 5000)]
543541

544542
return edgestarts
545543

0 commit comments

Comments
 (0)