Skip to content

faq 109877746

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

routing fastest travel time

by oussama smiai on 2017-06-09 17:49:43


I would like to write a fastest routing algorithm. The algorithm should give the path with the shortest travel time .I followed the tutorial at tutorial.programming.example21tutorialTUBclass.leastCostPath but still the things are not clear. 


Comments: 3


Re: routing fastest travel time

by Ihab Kaddoura on 2017-06-23 14:56:40

oussama smiai (via private message):

I need some help to write a least time routing algorithm. The problem is that getLinkTravelTime(Link link, double time) from TravelTimeCalculator is always giving  a constant value even if the link capacity is one and we are simulating 50000 vehicle in a small network.

Dear Oussama,

some ideas:

* Run the simulation for more than just one iteration! In the first iteration or if there is no information about a link’s average travel time in a specific time bin, getLinkTravelTime uses the free speed travel time. If you run the simulation for more iterations, the method will look at the previous iteration and probably see that there was a lot congestion and travel times will be (much) larger than free speed travel time.

* A link capacity of 1 vehicle/hour and a demand of 50000 vehicles seems to be rather extreme. For very long queues with spill-back, agents may stuck. Depending on what you have specified what happens with stucking agents, they might affect your travel time statistics. To avoid stucking agents, set the stuckingTime to a very high value.

Hope this helps. If not, just specify your question or tell us more about the settings / provide the log file.

Best,

Ihab


Re: routing fastest travel time

by Kai Nagel on 2017-06-25 16:22:28

I think that that example tutorial.programming.example21tutorialTUBclass.leastCostPath explains the routing part, but not the link travel time feedback part.  For that to work, at least two more things would have to happen:

(1) MatsimClassLeastCostPathCalculatorFactory would have to pass TravelTime and TravelDisutility through:

return new MatsimClassDijkstra(network,travelCosts,travelTimes);

(2) MatsimClassDijkstra would actually have to use these two.  The place where this is actually fully programmed out is org.matsim.core.router.Dijkstra.  

This is actually not totally easy; I suggest to proceed in small steps.  If you get stuck for more than 2 hours, please ask another question and we will try to help.


Re: routing fastest travel time

by oussama smiai on 2017-06-27 08:02:54

Thank you for the answer,

I runned the org.matsim.core.router.Dijkstra algorithm for many iterations and the  getLinkTravelTime(Link link, double time) is still giving constant values. I would like to know how can I check the current iteration number in org.matsim.core.router.Dijkstra . I mean by the iteration number the iteration number specified in config.xml.

<param name="firstIteration" value="0" />
 <param name="lastIteration" value="0" />
Clone this wiki locally