Skip to content

Conversation

andig
Copy link
Member

@andig andig commented Oct 11, 2025

Fix #24497

The meta plan handler provides sequential handling for multiple concurrent plans in a load management-restricted environment. It does so by calculating the total plan duration for all active plans and creating an optional overall plan. The overall plan is then sliced into individual plans.

TODO

  • calculate meta plan
  • improve calculating meta plan by step-wise combination of overlapping plans
  • visualize meta plan
  • Make loadpoint planner use meta plan slots

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Add a guard for the case when res.Loadpoints is empty before calling lo.MinBy to avoid a runtime panic on no loadpoints.
  • The nested loops for overlap computation can double-count shared intervals; consider merging and summing intervals (line sweep) to get the true union duration.
  • Extract the interval-union and latestStart logic into a separate helper function for clarity and to enable unit testing of the meta-plan calculations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Add a guard for the case when res.Loadpoints is empty before calling lo.MinBy to avoid a runtime panic on no loadpoints.
- The nested loops for overlap computation can double-count shared intervals; consider merging and summing intervals (line sweep) to get the true union duration.
- Extract the interval-union and latestStart logic into a separate helper function for clarity and to enable unit testing of the meta-plan calculations.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@andig andig added the backlog Things to do later label Oct 11, 2025
@andig andig marked this pull request as draft October 16, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backlog Things to do later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ladeleistung bei der Ladeplanung von zwei Fahrzeugen berücksichtigen

1 participant