Skip to content

Commit

Permalink
Merge branch 'main' into flank-protection
Browse files Browse the repository at this point in the history
  • Loading branch information
arneboockmeyer committed Jun 24, 2024
2 parents fa23776 + c031aa2 commit 935a44c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion interlocking/model/point.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ def is_only_used_by_train(self, train_id: str):
return len(self.used_by) == 1 and train_id in self.used_by

def is_track_connected(self, track):
return track.base_track_id in {self.head.base_track_id, self.left.base_track_id, self.right.base_track_id}
all_base_ids = []
if self.head is not None:
all_base_ids.append(self.head.base_track_id)
if self.left is not None:
all_base_ids.append(self.left.base_track_id)
if self.right is not None:
all_base_ids.append(self.right.base_track_id)
return track.base_track_id in all_base_ids

def does_point_connect_tracks(self, track_1, track_2):
if not self.is_point:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.poetry]
name = "interlocking"
version = "2.0"
version = "2.0.1"
description = "A simple yaramo-based interlocking logic"
authors = ["OSMHPI <[email protected]>"]
authors = ["Arne Boockmeyer <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
Expand Down

0 comments on commit 935a44c

Please sign in to comment.