New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promote PtNetworkSimplifier to org.matsim package #2149
base: master
Are you sure you want to change the base?
Conversation
Thanks for your suggestion. @vsp-gleich do you have an oppinion on this? Otherwise this looks fine for merging to me. |
This class can be useful for models in which pt is sharing the network with car and other modes. Usually we have pt on a separate pseudo network for which no simplification should be possible. So, this is for now not the most essential functionality which must reside in the matsim core. But I'm not really against moving it either. |
Background info: I used it actually to create pseudo-pt networks from networks generated with PT2MATSim. There, pt routes are mapped to OSM ways (while keeping their link geometries) and simplification was really helpful. If you do not need your pseudo-pt network to have real link geometries, then you can just create the pseudo-pt network from the schedule alone and don't need simplification. |
That makes sense, thank you for explaining! Actually when using pt2matsim to map stops to osm ways wouldn't it be helpful to then have the same simplification functions as the standard NetworkSimplifier? Especially if buses shall share the normal car network (since they are already mapped to it and road congestion effects are nice to have)? |
I would not automatically call the network simplifier from here. If someone is interestend in doing both, I would think it is better to do so explicitly. I am not sure whether I completely understood your suggestion though 🙃. |
Thank you for adding a test for the modified TransitRoute! |
NetworkSimplifier and PtNetworkSimplifier have quite some overlaps (e.g. method bothLinksHaveSameLinkStats() and parts of the run() method), but neither can fully replace the other. This opens questions for code maintainability and end users. I fear some users will not be aware of both versions and their limitations, and will e.g. use NetworkSimplifier without thinking about consequences for pt services or re-implement features in PtNetworkSimplifier that already exist in NetworkSimplifier (e.g. more constraint/filter options to chose which links can be merged). That's why maybe merging the PtNetwork stuff into NetworkSimplifier might be better. |
Now, that you've explained this to me offline, I do agree with your preference to merge the pt-simplifier into the regurlar @marecabo would you be willing to do that instead? |
@vsp-gleich Thanks for the discussion last week. When I find some time to merge both, can I get rid of the these parts from the NetworkSimplifier, as they run method allowing to vary
The latter two parts have no function if someone uses a thresholdLength = positive infinity as recommended in Kai's comment. |
Hi @marecabo , thanks for taking up my suggestion! I tend to say yes you can remove the deprecated method, but please keep Kai's comments somehow. The NetworkSimplifierTest also uses the deprecated run method, so removing the deprecated run method will cause some work over there too. |
With this PR, I'd suggest to move the
PtNetworkSimplifier
to the org.matsim package.Recently, I used the
PtNetworkSimplifier
from the vsp playground a lot and it worked well as expected. Credits and many thanks to aneumann (is it @neuma?) for it.I changed and added a few things:
NetworkSimplifier