next up previous contents
Next: Feedback/System integration Up: Congestion-dependent router Previous: Link travel times and   Contents

Congestion dependency: Link travel times

We need to get the congestion information into the router. More specifically, we need that the correct link travel time information is returned by link->tTime(now) in Sec. 11.7.

As said above, the way we do this is by reading the events file, calculating each vehicle's link travel times, and then aggregating those times into the desired time bins. Here is a suggestion of a method to do this; comments are added below.


/home/nagel/src/book/router/book/EnterEvent /home/nagel/src/book/router/book/RouteWorld::readEvents

Comments:

The correct link travel time is now returned by


/home/nagel/src/book/router/book/Link::tTime

Note that this uses the free speed travel time if no events information is available. Here, we use the global variable GBL_FREE_SPEED; this could be replaced by link-dependent free speeds in more sophisticated implementations. However, when doing this, one needs to make sure that also the traffic simulation generates link-dependent free speeds. Our simulation of Chap. 7 does not do this; improving this will be discussed in Chap. 17.

It is useful to note that all conversions from time-of-day to time-bins is done via the function timeToBin. The inverse conversion (from time bins to time-of-day) is never needed. This makes sure that if the router requests information for a certain time-of-day, it will always receive the same time bin that a link entry event at the same time would have obtained.12.1

Clearly, the overall integration into the router has to look as follows:


{}
int main() {
    // instantiate routeWorld:
    RouteWorld routeWorld ;

    // read the network:
    routeWorld.readNodes() ;
    routeWorld.readLinks() ;

    // read the events:
    routeWorld.readEvents() ;

    // main loop:
    ...
}

Task 12.1   Write routines which read the events. Check if the processing of


        http://www.matsim.org/files/studies/corridor/teach/test.events

leads the link travel times would expect. (Which values would you expect?)

Task 12.2   Run FindPath together with


        http://www.matsim.org/files/studies/corridor/teach/test.events

on the first trip in


        http://www.matsim.org/files/studies/corridor/teach/0.trips

Which route is returned? Is this different from the route returned in Task 11.2? Why?

Task 12.3   Get the events file that was produced by running the traffic micro-simulation on


        http://www.matsim.org/files/studies/corridor/teach/0.plans

Read those events, and then apply your router to


        http://www.matsim.org/files/studies/corridor/teach/0.trips

Give the resulting routes file to the micro-simulation and have it executed. Does the result make sense? Why or why not?


next up previous contents
Next: Feedback/System integration Up: Congestion-dependent router Previous: Link travel times and   Contents
2004-02-02