Skip to content

Commit

Permalink
fix: repairing of completely overlapping trips in ENTD
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Jul 5, 2024
1 parent 6013e94 commit 732bfe2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

**Under development**

- fix: fixed special case in repairing ENTD for completely overlapping trips
- feat: make it possible to disable the test run of MATSim before writing everything out
- feat: check availability of open data sources for every PR
- feat: make statistical matching attribute list configurable
Expand Down
5 changes: 3 additions & 2 deletions data/hts/hts.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ def fix_trip_times(df_trips):
print(" of which we're able to shorten %d to make it consistent" % np.count_nonzero(f))
df_main.loc[f, "arrival_time"] = df_next["departure_time"]

# Included trips
# Included trips (moving the first one to the start of the following trip and setting duration to zero)
f = ~df_main["is_last_trip"]
f &= df_main["departure_time"] >= df_next["departure_time"]
f &= df_main["arrival_time"] <= df_next["arrival_time"]
df_main.loc[f, "departure_time"] = df_next["departure_time"]
df_main.loc[f, "arrival_time"] = df_next["departure_time"]
print("Found %d occurences where current trip is included in next trip" % np.count_nonzero(f))
df_main = df_main[~f]

return df_main

Expand Down

0 comments on commit 732bfe2

Please sign in to comment.