From 27ffbf51b03a678b2a3cb8c8cdfe8c33438dcb40 Mon Sep 17 00:00:00 2001 From: u229187 Date: Wed, 11 Oct 2023 17:21:59 +0200 Subject: [PATCH] also add setters for Access / Egresstimes --- .../pt/transitSchedule/TransitScheduleUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/matsim/src/main/java/org/matsim/pt/transitSchedule/TransitScheduleUtils.java b/matsim/src/main/java/org/matsim/pt/transitSchedule/TransitScheduleUtils.java index daa09376a11..e06377d0351 100644 --- a/matsim/src/main/java/org/matsim/pt/transitSchedule/TransitScheduleUtils.java +++ b/matsim/src/main/java/org/matsim/pt/transitSchedule/TransitScheduleUtils.java @@ -45,10 +45,22 @@ public static double getStopAccessTime(TransitStopFacility stopFacility){ return accessTime!=null?(double) accessTime:0.0; } + public static void setStopAccessTime(TransitStopFacility stopFacility, double stopAccessTime){ + stopFacility.getAttributes().putAttribute(ACCESSTIME_ATTRIBUTE,stopAccessTime); + } + public static double getStopEgressTime(TransitStopFacility stopFacility){ Object egressTime = stopFacility.getAttributes().getAttribute(EGRESSTIME_ATTRIBUTE); return egressTime!=null?(double) egressTime:0.0; } + public static void setStopEgressTime(TransitStopFacility stopFacility, double stopEgressTime){ + stopFacility.getAttributes().putAttribute(EGRESSTIME_ATTRIBUTE,stopEgressTime); + } + + public static void setSymmetricStopAccessEgressTime(TransitStopFacility stopFacility, double stopAccessEgressTime){ + setStopAccessTime(stopFacility,stopAccessEgressTime); + setStopEgressTime(stopFacility,stopAccessEgressTime); + } public static QuadTree createQuadTreeOfTransitStopFacilities(TransitSchedule transitSchedule) { return createQuadTreeOfTransitStopFacilities(transitSchedule.getFacilities().values());