From 2aefe2948c4188f5ec5cbcc5a0f6077346d5403a Mon Sep 17 00:00:00 2001 From: Yue Shuai <48269801+yueshuaing@users.noreply.github.com> Date: Thu, 14 Mar 2024 14:28:33 -0700 Subject: [PATCH] update wlk_trn_wlk journey file --- .../network/transit/transit_assign.py | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tm2py/components/network/transit/transit_assign.py b/tm2py/components/network/transit/transit_assign.py index 3e804f2f..ea7c419f 100644 --- a/tm2py/components/network/transit/transit_assign.py +++ b/tm2py/components/network/transit/transit_assign.py @@ -2231,13 +2231,41 @@ def _journey_levels(self) -> EmmeTransitJourneyLevelSpec: elif self.name == "WLK_TRN_WLK": new_journey_levels = copy.deepcopy(journey_levels) - transition_rules = copy.deepcopy(journey_levels[0]["transition_rules"]) + + for i in range(0, len(new_journey_levels)): + jls = new_journey_levels[i] + jls["transition_rules"].extend( + [ + {"mode": "e", "next_journey_level": i+1}, + {"mode": "w", "next_journey_level": i+1}, + { + "mode": "a", + "next_journey_level": i+1, + }, + ] + ) + # level 0: only allow walk access and walk auxilary + # must use the trasit modes to get onto the next level, + transition_rules_walk = copy.deepcopy(journey_levels[0]["transition_rules"]) + transition_rules_walk.extend( + [ + { + "mode": "e", + "next_journey_level": 0, + }, + { + "mode": "w", + "next_journey_level": 0, + }, + {"mode": "a", "next_journey_level": 0}, + ] + ) new_journey_levels.insert( 0, { "description": "base", - "destinations_reachable": True, - "transition_rules": transition_rules, + "destinations_reachable": False, + "transition_rules": transition_rules_walk, "waiting_time": None, "boarding_time": None, "boarding_cost": None,