From 4c5a870e7cd6d86c0183c9ceff55d4d41bab3755 Mon Sep 17 00:00:00 2001 From: Arne Boockmeyer Date: Wed, 14 Feb 2024 14:40:42 +0100 Subject: [PATCH 1/2] Avoid problems having side tracks (parallel tracks with same start and end node) --- interlocking/model/point.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/interlocking/model/point.py b/interlocking/model/point.py index f0594cb..407e7e8 100644 --- a/interlocking/model/point.py +++ b/interlocking/model/point.py @@ -47,7 +47,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: From c031aa28aa3e60eb05402ede3c4c8f407b527d41 Mon Sep 17 00:00:00 2001 From: Arne Boockmeyer Date: Thu, 20 Jun 2024 15:16:22 +0200 Subject: [PATCH 2/2] Update authors and version number --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8927c0c..0e9f8ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.poetry] name = "interlocking" -version = "2.0" +version = "2.0.1" description = "A simple yaramo-based interlocking logic" -authors = ["OSMHPI "] +authors = ["Arne Boockmeyer "] readme = "README.md" [tool.poetry.dependencies]