brickrail icon indicating copy to clipboard operation
brickrail copied to clipboard

multiple paths between same nodes can't be used in case of crossing blocked or similar

Open Novakasa opened this issue 3 years ago • 2 comments

in the layout that was added in e20219a65656c7ff53b7118a927ecc0915e8feae the train doesn't take the shorter one by default. even when the longer one is blocked by crossings, it doesn't chose the other route. This is because the edges of nodes are stored in dictionaries with keys corresponding to the targets. This means there will only be one edge collected. This might be a low priority issue because if there are blocks on one of the routes, the problem doesn't occur (no same start and end nodes)

Novakasa avatar Jan 14 '22 14:01 Novakasa

Only way to fix this might be to store edges in lists in dictionaries. But then the dijkstra implementation would be quite a bit more laborious, because you can't only reference the from_node to specify the edge.

Novakasa avatar Jan 14 '22 14:01 Novakasa

One could only put the edges in the dictionary which are shorter than the previous one or not blocked. This would put some complexity in collect_edges but might be the easier solution that covers all needs

Novakasa avatar Jan 14 '22 14:01 Novakasa