matsim-org / matsim-code-examples

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

DRT route #622

Open elyh1992 opened 2 years ago

elyh1992 commented 2 years ago

Hi,

When I check output plan file for car trips I get the actual list of links that agent has traveled as route but in case of DRT (ridesplitting) in the route part I get some numbers that I don't understand their meaning. Is there a way to get the route for DRT similar to car? Thank you for your help in advance.

car 193740 375319 230832 198527 167255 103354 ridesplitting 600.0 198.73200368783728
michalmac commented 2 years ago

These are the attributes you obtain: https://github.com/matsim-org/matsim-libs/blob/master/contribs/drt/src/main/java/org/matsim/contrib/drt/routing/DrtRoute.java#L106-L107

In a newer MATSim version (14.0-PR1579 and later), you should get a json-formatted description like this:

{"maxWaitTime":600.0,"directRideTime":198.73200368783728,"unsharedPath":[]}

BTW. Not sure why unsharedPath is always empty. Will look into that.

elyh1992 commented 2 years ago

These are the attributes you obtain: https://github.com/matsim-org/matsim-libs/blob/master/contribs/drt/src/main/java/org/matsim/contrib/drt/routing/DrtRoute.java#L106-L107

In a newer MATSim version (14.0-PR1579 and later), you should get a json-formatted description like this:

{"maxWaitTime":600.0,"directRideTime":198.73200368783728,"unsharedPath":[]}

BTW. Not sure why unsharedPath is always empty. Will look into that.

Thanks a lot for your answer. I just have another quick question. What defines the gap between "person enter vehicle" and "vehicle enter traffic" in DRT. Why in some cases it actually takes longer for the vehicle to enter traffic once the passenger enters the vehicle? I even have some cases in event file that time difference between "person enter vehicle" and "vehicle enter traffic" is 2000 seconds.

michalmac commented 2 years ago

Congestion could be one possible reason. Please have a look at this setting: https://github.com/matsim-org/matsim-libs/blob/0567897a8385ed5714e8ff4dab24001dcddbcf5e/contribs/dvrp/src/main/java/org/matsim/contrib/dvrp/run/DvrpConfigGroup.java#L143-L155