From 02cab0eaea177cfcdbdf39c06d2333801cd15bb6 Mon Sep 17 00:00:00 2001 From: Tobias Kohl Date: Tue, 23 Jan 2024 19:15:27 +0100 Subject: [PATCH] go back to old parkingproxy method --- .../parking/parkingproxy/CarEgressWalkChanger.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/contribs/parking/src/main/java/org/matsim/contrib/parking/parkingproxy/CarEgressWalkChanger.java b/contribs/parking/src/main/java/org/matsim/contrib/parking/parkingproxy/CarEgressWalkChanger.java index b78bd899b78..20c0b113bed 100644 --- a/contribs/parking/src/main/java/org/matsim/contrib/parking/parkingproxy/CarEgressWalkChanger.java +++ b/contribs/parking/src/main/java/org/matsim/contrib/parking/parkingproxy/CarEgressWalkChanger.java @@ -121,14 +121,10 @@ public void notifyBeforeMobsim(BeforeMobsimEvent event) { private void changeEgressTimesByGridcell(Collection population, boolean reverse) { for (Person p : population) { for (LegActPair walkActPair : this.egressFinder.findEgressWalks(p.getSelectedPlan())) { + double penalty = Math.round(this.observer.getPenaltyCalculator().getPenalty(walkActPair.leg.getDepartureTime().seconds(), walkActPair.act.getCoord())); if (reverse) { - Object readPenalty = walkActPair.leg.getAttributes().getAttribute(PENALTY_ATTRIBUTE); - if (readPenalty != null) { - setTimes(walkActPair, - (double) readPenalty); - walkActPair.leg.getAttributes().removeAttribute(PENALTY_ATTRIBUTE); - } + setTimes(walkActPair, -penalty); } else { - double penalty = Math.round(this.observer.getPenaltyCalculator().getPenalty(walkActPair.leg.getDepartureTime().seconds(), walkActPair.act.getCoord())); setTimes(walkActPair, penalty); walkActPair.leg.getAttributes().putAttribute(PENALTY_ATTRIBUTE, penalty); }