Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Lietze committed Jul 12, 2023
1 parent 696852d commit cbe6925
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/interlocking_component/route_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,9 @@ def maybe_put_reservations_as_first(self, train: Train, route: List[Node]):
for i, edge in enumerate(edge_route):
if not edge.track.is_reservation_track:
continue
if edge.track.reservations[0][0].edge == edge:
# The train this is reserved for is already on the swgment, that may be swaped.
first_reserving_train = edge.track.reservations[0][0]
if edge in first_reserving_train.reserved_tracks[0].edges:
# The train this is reserved for is already driving towards the segment, that may be swaped.
return
if edge.track.reservations[0][0] == train:
self.put_reservations_as_first(train, edge_route[:i])
Expand Down

0 comments on commit cbe6925

Please sign in to comment.