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(ev): add charging priorities and reservations #3632

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

sebhoerl
Copy link
Contributor

@sebhoerl sebhoerl commented Dec 6, 2024

This PR makes three modifications to the ev contrib:

Testing

  • Some classes are made public as we need them to construct comprehensive unit tests for the ev contrib in later PRs.

Charging priorities

  • The ChargingPriority is introduced: it is used for managing the charging queue, which, currently, is a simple FIFO. With ChargingPriority we now traverse the queuing vehicles and let them pass on to charging if the ChargingPriority returns true. This means that we can retain certain vehicles if others should get plugged with a higher priority than them.

Reservations

  • A useful implementation of ChargingPriority is provided, which is ReservationBasedChargingPriority
  • As soon as a vehicle enters the queue of a charger, it is checked whether there is space and whether the vehicle has a reservation for the current time. Only if this is the case, the vehicle can directly pass on to charging.
  • If no reservation is found, the ChargingPriority tries to make a reservation ad-hoc. If this succeeds, the vehicle is also allowed to plug.
  • If no external intervention is happening (removing the vehicle from the charger, making a manual reservation), the vehicle will queue until, eventually, a spontaneous reservation can be made.
  • The main purpose, however, is that some external logic (for instance, let's say, dvrp charging planning) can explicitly make reservations in advance using the singleton service ReservationManager. Likewise, any external logic can check in advance if a charger is already fully booked at a future time.

@sebhoerl sebhoerl merged commit bee9a70 into master Dec 6, 2024
49 checks passed
@sebhoerl sebhoerl deleted the feat/ev/charging-priority branch December 6, 2024 20:27
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.

1 participant