Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drt: adjust analysis for dynamic vehicle fleets #3086

Open
sebhoerl opened this issue Feb 5, 2024 · 1 comment · May be fixed by #3104
Open

drt: adjust analysis for dynamic vehicle fleets #3086

sebhoerl opened this issue Feb 5, 2024 · 1 comment · May be fixed by #3104

Comments

@sebhoerl
Copy link
Contributor

sebhoerl commented Feb 5, 2024

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:

  • Introduce an AbstractFleetEvent in DVRP with two specific implementations VehicleAddedEvent and VehicleRemovedEvent
  • Modify the analysis packages in DVRP and DRT such that they detect these events
  • Instead of having one VehicleState for each vehicle to track the activity, we introduce a list of states because vehicles can be active during multiple periods of the day

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:

  • DRT takes a FleetDefinition when initializing the analysis components and then responds to events linked to those vehicle IDs
  • DVRP tracks TaskStartEvents and registers vehicles for analysis once they find a task with the right DVRP mode and task index = 0

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.

@sebhoerl sebhoerl changed the title drt: dynamic vehicle fleets drt: adjust analysis for dynamic vehicle fleets Feb 5, 2024
@michalmac
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants