matsim-org / matsim-code-examples

A repository containing code examples around MATSim
GNU General Public License v3.0
83 stars 180 forks source link

Adding turn restrictions to a network and preserving public transportation routes #463

Open idshklein opened 3 years ago

idshklein commented 3 years ago

Hi, I'm trying to translate turn restrictions from an EMME network to a MATSim network. I do so by using this piece of code: https://github.com/HTplex/Storage/blob/150731f8db5af912042c89a4f0bc47c1501d1447/java/playgrounds/toronto/src/main/java/playground/toronto/maneuvers/NetworkAddEmmeManeuverRestrictions.java However, I encounter a problem when trying to add public transportation routes. the PT routes are coded according to the original EMME network, Therefore, the new nodes and links added to the network after adding turn restrictions do not exist, and because of that I can't add the PT routes to the network. Has anyone encountered this type of problem before? I can think of one approach - using regex and checking if the next out link contain the the previously connected nodes. Is there an automated approach for solving this? i.e. adding the turn restrictions after the pt routes exist, and changing them according to the new network? I'd be happy for tips and additional info.

polettif commented 3 years ago

Don't know whether you found a solution to this but you could remove all links from a transitRoute and then reroute the schedule with the new network using pt2matsim. That way turn restrictions are considered and the new routes should work. Some extensions might be necessary because you already have a link for each stop facility so you could skip steps 1 to 3 of the algorithm. I can help you if you want to use this approach.