Skip to content

Add bahn.de/PTE-based test suite for RNV - #855

Merged
michaz merged 2 commits into
graphhopper:ptfrom
dbsystel:pt-testsuites
Nov 17, 2016
Merged

michaz merged 2 commits into
graphhopper:ptfrom
dbsystel:pt-testsuites

Conversation

@highsource

Copy link
Copy Markdown
Contributor

Here's a prototypical implementation of a test suite based on bahn.de data via PTE.

Trip queries are read from the CSV file (rnv-trips-least-duration-01.csv) and then executed in the GraphHopper. No assertions on results, just printing out. I've also reduced test cases to trips with just one leg because RNV does not have correct transfers.

As I ran the test it showed that GH PT sometimes gives good results, but in most cases it gives arrival time which is later than bahn.de. I hope these test cases will help in the analysis.

@michaz

michaz commented Nov 9, 2016

Copy link
Copy Markdown
Member

The problem here could be similar to the reason transfers don't work on the RNV dataset.

In RNV, every pole is one stop. A stop (or stop area) with poles in either direction is two stops in the RNV dataset. We currently only, strictly use the closest stop from the start and the destination.

That's probably why we often don't find a route.

In VBB, this is much easier, because all allowed transfers are explicit edges.

This test will only start giving nice results when we implement a transfer heuristic.

@michaz

michaz commented Nov 9, 2016

Copy link
Copy Markdown
Member

(The VBB dataset is currently too much for Travis, otherwise I'd suggest we do a similar test suite for VBB right away...)

@highsource

Copy link
Copy Markdown
Contributor Author

No, I'm explicitly checking only those routes which only had 1 leg with PTE.
I understand that it might be a bit early for this test. But I think it's still good to see the difference to bahn.de - as early as possible.

@karussell

Copy link
Copy Markdown
Member

I'm explicitly checking only those routes which only had 1 leg with PTE.

I also think if the stops of one line in the different directions would be connected (like they are for VBB or will be soon when we integrate walking) then the results would be better. Or one could slightly adjust the coordinates for the different directions.

Example: if you pick stop A (which has two nodes A1 and A2 for the same line but different direction) and want to go to B, then currently it can happen for RNV that it picks A2 routes you first outside of the city, comes back to A1 to route you to B.

@michaz

michaz commented Nov 9, 2016 •

Copy link
Copy Markdown
Member

Exactly, that's what I meant.

@michaz

michaz commented Nov 9, 2016

Copy link
Copy Markdown
Member

Anecdote: Testing the VBB dataset against bahn.de is super unfair, because they have more pessimistic transfer times in their GTFS than in Hafas, apparently. :-(

@highsource

Copy link
Copy Markdown
Contributor Author

bahn.de re-processes data delivered by transport companies on import. So it's more for orientation.

I'll try to implement OpenTripPlanner-based test data production as well. That should give fair results.

@michaz michaz self-assigned this Nov 16, 2016
@michaz
michaz merged commit d7ce84e into graphhopper:pt Nov 17, 2016
@michaz

michaz commented Nov 17, 2016 •

Copy link
Copy Markdown
Member

We can now run what the web site says against GraphHopper with unrestricted walking at 5 km/h:
Travel time is the duration between earliest start time and arrival time here, i.e. I leave home immediately, I don't wait for the scheduled trip.
traveltimes

Wow. Will start analysing this tomorrow.

@highsource

Copy link
Copy Markdown
Contributor Author

Below y=x (to the right/bottom) means GraphHopper reports shorter travel times compared to bahn.de?

@michaz

michaz commented Nov 18, 2016 •

Copy link
Copy Markdown
Member

Below y=x (to the right/bottom) means GraphHopper reports shorter travel times compared to bahn.de?

Yes. Those seem to be trips where the web site says they should take really long. Are those maybe stops where only one bus goes every few hours, and GraphHopper just walks?

I haven't had time to look at this in any way yet, just wanted to show that we can do the picture now.

@highsource

Copy link
Copy Markdown
Contributor Author

Should I do a VBB suite as well? Does it help?

@michaz

michaz commented Nov 18, 2016 •

Copy link
Copy Markdown
Member

Yes, please! It helps a lot. VRN will then be our unrestricted-walking/multimodal/experimental-behavior scenario, and VBB will be our strictly-do-what's-in-gtfs scenario. (I think this is way more important than comparing ourselves to OTP, for example.)

Not sure where to put this, though, as the VBB dataset is a bit too big for automatic integration tests yet.

I may put it in a separate project, together with my PTE-as-additional-API-for-GH experiment.

@michaz

michaz commented Nov 18, 2016

Copy link
Copy Markdown
Member

bahn.de seems to produce unexpectedly long solutions sometimes:
screen shot 2016-11-18 at 12 41 19

@highsource I wonder, would it be difficult to re-generate the .csv file using the VrnProvider instead of bahn.de? If it's easy for you, please feel free to just commit. 

@highsource

Copy link
Copy Markdown
Contributor Author

This should not be too complicated but will take some time.

BTW I get 1h23m for this query with VRN.

@highsource

Copy link
Copy Markdown
Contributor Author

Hm, this is a very good approach to identify weaknesses in bahn.de. Kind of cross-comparison for the same queries among providers. This might be pretty useful.

@michaz

michaz commented Nov 18, 2016

Copy link
Copy Markdown
Member

(Wouldn't need to be exactly the same instances, of course. Can be newly randomized.)

@michaz

michaz commented Nov 18, 2016 •

Copy link
Copy Markdown
Member

Next version:
traveltimes
In the previous picture, everybody was walking, because the schedule didn't fit the data, so we were basically just plotting bahn.de travel time against distance. I'm using the new schedule now, which covers all of November.

Now, something like a diagonal is emerging. The remaining red dots are the remaining walk-only solutions.

@michaz

michaz commented Nov 18, 2016

Copy link
Copy Markdown
Member

The bulge over the diagonal starts around an hour or two. Maybe that's where bahn.de is starting to use long-distance trains which we don't know about.

@highsource

Copy link
Copy Markdown
Contributor Author

I think long-distance is disabled in the query.

@michaz

michaz commented Nov 19, 2016

Copy link
Copy Markdown
Member

I think long-distance is disabled in the query.

Hmm, okay, nice try though. ,-)

@michaz

michaz commented Nov 19, 2016

Copy link
Copy Markdown
Member

Ah, it's the S-Bahn.

@karussell karussell mentioned this pull request Dec 3, 2016
@karussell karussell mentioned this pull request Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants