Skip to content

faq 62947356

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

How to implement park and ride trips?

by Imran Sharif us Salam on 2016-05-24 15:30:30


 I had asked following question to which Mr. Thibaut Dubernet  had replied. Somehow accidently both question and answer got deleted. So I have copied from my email, and pasted both (question and answer) again here for benefit of others like me.

 

Mr. Thibaut! Thank you very much for your detailed reply. I am working on code as you have advised and will get back with update.

Regards,

Imran

 

 

 
Imran Sharif us Salam

Hello All,

My name is Imran and I am masters’ student at University of Toronto. For my thesis, I am extending Toronto’s existing model in MATSim. This is my first ever post in this forum. I am struggling with implementation of Park and Ride and writing this post to seek guidance.

Demand for Toronto’s model is generated from individual trips obtained through travel survey and currently only route choice is implemented.

For park and ride If I have correctly understood, multi stage trips (tutorial example 13) will have to be generated, however I have got few missing dots when I relate example 13 with “router package description”.

The description states that we have to have a separate routing module for each mode, but in example 13 we have only one routing module although we have two modes ie, transit and teleportation mode. Moreso routing module was not registered with trip router(as required in router description). I will appreciate if guidance could be provided on following aspects.

  1. For a typical home-work-home sequence (two trips), how can I extend the concept of example 13.
  2. How many routing modules will have to written and how these will be registered with TripRouter.
  3.  What changes would be needed in code of controller?

 

Best Regards,

Imran Sharif us Salam 

  Thibaut Dubernet answered the question
 
How to implement park and ride trips?  network routing

Dear Imran,

 

your confusion is pretty understandable: it seems you had information from two different states of the code source. I will try to go through the javadoc and update it as needed: sorry about that.

Basically, we are currently in the process of switching from a ad-hoc system of factories to the Guice framework to combine modules together. Not so long ago, to configure the routing process, one had to configure a TripRouterFactory object by giving it RoutingModuleFactories, which themselves created RoutingModules. Now, you only have to implement am AbstractModule, and register your routing modules using the addRoutingModuleBinding() method. You might want to search for a Guice tutorial on the web to get the idea of what "binding" means in this context.

Adding a routing module following example 13 does not erase the settings from the config, so that all modes that use standard Matsim routing can still be configured from the config file, which is why you only see the telportation mode configured in the code. Actually, the example tries to demonstrate that: it creates a new mode, where one takes PT to a SciFi teleportation portal, and then get teleported immediately to the destination. Those initial PT sub-trips are computed with the pre-existing public transport router: reconfigure PT from the config, SciFi teleportation trips will use it.

So on a first look, P+R would be similar, where you would create a routing module that uses the car and the pt routing module to route its sub-trips. There is however a serious issue: RoutingModules are not aware of the context of the trip, which means that for the P+R return trip, they cannot know where they have to pick-up the car. So I would actually NOT include P+R in routing at all, but create a standard ReplanningStrategy, that places P+R "activities" in the plans, with a feasible sequence of modes, and then gives this plan to the PlanRouter. You might want to have a look at org.matsim.core.replanning.strategies.SubtourModeChoicePlanStrategyProvider to get an idea of how to implement such a strategy.

Hope this helps.

 

 


Comments: 0

Clone this wiki locally