Modeling collective taxis in MATSim

Main concepts/features

Large Scale

The service is available 24h per day, 7 days a week.

The vehicles are ranging from minivans to minibuses (approximately 6 to 12 passengers)

The service works without fixed stations

Taxis can be taken on the fly (smart phones)

Modeling Hypothesis

Price and utility parameters based on those of other modes in MATSim-T

Available to all agents at every point in time and space

No capacity restrictions (unlimited capacity)

Bibliographic reference:

Ciari, F., M. Balmer and K.W. Axhausen (2009) Large scale use of collective taxis: a multi-agent approach, paper presented at the 12th International Conference on Travel Behaviour Research, Jaipur, December 2009.

Possible future developments

Michal Maciejewski is looking into using MATSim to generate realistic instances of the dynamic vehicle routing problem (DVRP). If one wants to avoid that the DVRP program can "cheat", requests for service should not come out of MATSim before their time.  There seem to be the following types of requests:

  1. Get me a taxi/courier as soon as possible.
  2. Get me a taxi/courier for a specified departure time.
  3. Get me a taxi/courier for a specified arrival time.

Let me first look at taxis (i.e. persons make requests for themselves).

The first seems to be relatively easy to model: The leg mode would be "taxi"; the person would end its activity, go into the corresponding departure handler, which would request a taxi and then put the person into the departure queue (presumably, the same as there is for pt, although I am not sure if there is one per link or just one per pt stop).

The second is more difficult.  Sending out the request when the activity starts is too early, and the DVRP may use that to its advantage.  Possibilities that come to my (kn's) mind:

  1. We add something like "prescheduled event" to matsim.  Then, an agent starting an activity at time t, could pre-schedule an event for time t + tau.
  2. Sending a request during an activity will only be implemented together with within-day replanning.
  3. The agent ends its activity when it makes the request, and then just sits in the departure queue.

Option 1. seems plausible at first glance.  Yet, it looks like it will cause additional headaches if this is ever combined with within-day replanning (because matsim would need to check which pre-scheduled events an agent has left around when it changes its plan).  Given our past experiences with such "quick fixes", this does not sound like a great idea.

Option 2. seems plausible (to me).  Within-day agents might be contacted, say once a minute, and asked if they want to call taxi for a pre-scheduled time in the future.

Option 3. seems a plausible fix for the meantime (to me).  It will produce wrong results with respect to agent scoring, but at least it will generate correct taxi requests.

Now courier service

Seems to me that I don't know enough about this.  Freight, at this point, is planned to be plugged into matsim by using "truck drivers".  I.e. from the point of view of matsim, the transportation of goods will just be a side effect of a driver moving a vehicle from A to B, and that vehicle being loaded with certain goods.

Clearly, we can still make up courier requests without following the goods.  For this, once more the within-day agents seems like the most consistent option.

Taxis in MATSim

Once there are requests, there need to be taxis.  Personally, I would start with a single taxicab.  In terms of implementation, this would probably inherit from what is currently (may'11) called ExperimentalBasicWithindayAgent.

(Using delegation/composition instead of inheritance is difficult with matsim agents, since "this" inside some delegated logic points to the delegate, not to the composing object.  Yet, the "this" is used to remove the agent from data structures, and insert it into others (e.g. at-activity data structure, wait data structure, in-vehicle data structure).)

As a first step, I would make the taxi agent, every time it arrives somewhere, generate a next activity location and then drive there.

As a second step, I would try to make that taxi agent pick up a waiting passenger and deliver it.

After some thinking, my intuition is that I would stay away from the pt code.  Picking up passengers can as well be done with regular arrival, I would think, and that would be much less intrusive.

Update (jul'11): There is an "AdapterAgent" in Michael Z.'s playground, and Michal M. has started using that for his taxicab prototype.


Warning: Table 'watchdog' is read only query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Table &amp;#039;sessions&amp;#039; is read only\nquery: UPDATE sessions SET uid = 0, cache = 0, hostname = &amp;#039;38.107.179.231&amp;#039;, session = &amp;#039;&amp;#039;, timestamp = 1328355471 WHERE sid = &amp;#039;e972b2ab7dd755a2094beea8ac708f02&amp;#039;</em> in <em>/home01/vsp_access/matsimwww/includes/database.mysql.inc</em> on line <em>174</em>.', 2, '', 'http://matsim.org/node/379', '', '38.107.179.231', 1328355471) in /home01/vsp_access/matsimwww/includes/database.mysql.inc on line 174