Skip to content

Commit

Permalink
Merge pull request #647 from flow-project/fix-grid-scenario
Browse files Browse the repository at this point in the history
Quick fix grid scenario
  • Loading branch information
nathanlct committed Jul 19, 2019
2 parents 8672844 + e815320 commit 1f68535
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions flow/scenarios/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,17 @@ def new_con(side, from_id, to_id, lane, signal_group):

# TODO necessary?
def specify_edge_starts(self):
"""See parent class.
Edges go in the following order: vert_right, vert_left, horz_right,
horz_left.
"""
"""See parent class."""
edgestarts = []
for i in range(self.col_num + 1):
for j in range(self.row_num + 1):
index = "{}_{}".format(j, i)
edgestarts += [("left" + index, 0 + i * 50 + j * 5000),
("right" + index, 10 + i * 50 + j * 5000),
("top" + index, 15 + i * 50 + j * 5000),
("bot" + index, 20 + i * 50 + j * 5000)]
if i != self.col_num:
edgestarts += [("left" + index, 0 + i * 50 + j * 5000),
("right" + index, 10 + i * 50 + j * 5000)]
if j != self.row_num:
edgestarts += [("top" + index, 15 + i * 50 + j * 5000),
("bot" + index, 20 + i * 50 + j * 5000)]

return edgestarts

Expand Down

0 comments on commit 1f68535

Please sign in to comment.