matsim-org / matsim-libs

Multi-Agent Transport Simulation
www.matsim.org
461 stars 436 forks source link

drt: adjust analysis for dynamic vehicle fleets #3086

Open sebhoerl opened 5 months ago

sebhoerl commented 5 months ago

In an upcoming PR we want to implement peer-to-peer car-sharing in the shared_mobility contrib. The idea is that vehicle owners can either share with other individuals or contribute their (automated) vehicle temporarily to a managed fleet. Technically, this means that we temporarily integrate new vehicles into a DVRP/DRT fleet. This works without a problem with DVRP and DRT: We just override a new Fleet implementation that allows adding and removing vehicles on the fly. Everything works surprisingly smoothly, only the analysis code makes certain assumptions that are not compatible with a dynamic fleet.

Therefore, we would like to propose flexibilizing the analysis with the following steps:

What do you think about that? Is this something that sounds interesting or should we find another solution? @michalmac

There is one design decision we are unsure about. Currently, handling the fleet is managed differently in DVRP and DRT:

We could replace this logic by publishing a VehicleAddedEvent by default at the beginning of the iteration and then respond to it in both cases. But this is not fully necessary, we can just treat added vehicles as a special case.

michalmac commented 5 months ago

What do you think about that? Is this something that sounds interesting or should we find another solution? @michalmac

I think this is a nice idea.

There is one design decision we are unsure about. Currently, handling the fleet is managed differently in DVRP and DRT: [...]

I think it is fine to adapt the current behaviour in DVRP/DRT the way you suggested.

Maybe it is even fine to make the DVRP fleet really dynamic to reflect the availability of vehicles: so instead of events being created to mimic the addition/removal, vehicles are actually added/removed to the fleet which then triggers corresponding added/removed events. I cannot tell if the effort required to implement this is worth it.