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

feat(drt): add/remove vehicles dynamically during qsim #3104

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

sebhoerl
Copy link
Contributor

@sebhoerl sebhoerl commented Feb 9, 2024

This is a draft for introducing dynamic vehicle fleets in DVRP/DRT. The PR fixes #3086.

Major changes:

  • Fleet is now an object with its own logic. In particular, it generates generats events when vehicles are added and removed; VehicleAddedEvent and VehicleRemovedEvent.
  • DVRP and DRT are responsive to a changing fleet size during the day. The DRT distance analysis has become totally independent of the fleet specification itself.
  • Instead of providing a Fleet from a FleetSpecification, users now need to implement a FleetCreator. However, it works 99% analogously to the previous logic of creating a fleet. In most cases, this is changing two lines of code (see code changes in the unit tests). The change is necessary as Fleet has now become a container object to which vehicles are added at start-up or later on during the simulation.
  • The code allows to flexibly move vehicles from one DVRP mode to another one (first removing it, then adding it to the other one).
  • Adding vehicles from scratch is a bit more tricky, as we need to register the vehicle with (1) Fleet, (2) QSim, (3) DynActivityEngine and DRT vehicles also need to get an initial task assigned. For that, two helper classes have been introduced: FleetExtensionHelper (is a MobsimEngine), and DrtFleetExtensionHelper (delegates to the former).

All of this functionality is covered by RunDrtExampleIT.testRunWithVariableFleetSize. Here is an example of the integration test's output. Three vehicles are added dynamically between 8h00 and 12h00, thus, giving additional capacity during that period:

output_occupancy_time_profiles_StackedArea_drt

@sebhoerl
Copy link
Contributor Author

sebhoerl commented Feb 9, 2024

This is a first draft. There are probably certain things to clean up still. And obviously the events files of the taxi contrib need to be updated.

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 this pull request may close these issues.

drt: adjust analysis for dynamic vehicle fleets
1 participant