Skip to content

Commit

Permalink
Merge branch 'senozon_branch' of https://github.com/matsim-org/matsim…
Browse files Browse the repository at this point in the history
…-libs into senozon_branch

# Conflicts:
#	contribs/parking/src/main/java/org/matsim/contrib/parking/parkingproxy/CarEgressWalkChanger.java
  • Loading branch information
Tobias Kohl committed Nov 21, 2023
2 parents 2670b61 + 22fd1b3 commit cc7f9bb
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ private void changeEgressTimesByGridcell(Collection<? extends Person> population
for (Person p : population) {
for (LegActPair walkActPair : this.egressFinder.findEgressWalks(p.getSelectedPlan())) {
if (reverse) {
double penalty = Math.round((double) walkActPair.leg.getAttributes().getAttribute(PENALTY_ATTRIBUTE));
setTimes(walkActPair, -penalty);
walkActPair.leg.getAttributes().removeAttribute(PENALTY_ATTRIBUTE);
Object readPenalty = walkActPair.leg.getAttributes().getAttribute(PENALTY_ATTRIBUTE);
if (readPenalty != null) {
setTimes(walkActPair, - (double) readPenalty);
walkActPair.leg.getAttributes().removeAttribute(PENALTY_ATTRIBUTE);
}
} else {
double penalty = this.observer.getPenaltyCalculator().getPenalty(walkActPair.leg.getDepartureTime().seconds(), walkActPair.act.getCoord());
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);
}
Expand Down

0 comments on commit cc7f9bb

Please sign in to comment.