Skip to content

feat: anchor charge continuity on the running session - #157

Merged
andig merged 2 commits into
feat/fewer-charging-interruptionsfrom
feat/continuity-anchor
Sep 17, 2026
Merged

andig merged 2 commits into
feat/fewer-charging-interruptionsfrom
feat/continuity-anchor

Conversation

@andig

@andig andig commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

stacked on #151, pairs with evcc-io/evcc#33802

The continuity stage counts charge starts inside a plan, but it assumes every device enters the horizon switched off. A car that is charging right now therefore scores one start whether the plan keeps it running or stops it and restarts one slot later, so the interruption stays a free choice. Snapshots from a real session show that tie being resolved both ways between consecutive solves, with the charger commanded off and on again inside the same flat price window.

  • c_active reports whether a device is charging at the start of the horizon. It then enters the horizon switched on, so continuing costs no start and interrupting costs one.
  • The stage now also runs when a charging device has a single block that begins later, which is exactly the interruption case the old gate skipped.
  • The economics are untouched: the cost, preference and grid peak bounds already pin the incumbent, so the anchor only decides between equally priced schedules.

🤖 Generated with Claude Code

The continuity stage assumed every device enters the horizon switched off, so keeping a
running session on scored the same as stopping it and restarting one slot later. A device
reporting c_initial above zero now enters the horizon on: continuing costs no start,
interrupting costs one, and a plan that only moves the start earlier is worth polishing.
@andig andig added the enhancement New feature or request label Sep 17, 2026
Only the on/off state decides a charge start, so c_active says that directly instead of
making the model derive it from a power value it never uses.
@andig
andig merged commit ec5c0f3 into feat/fewer-charging-interruptions Sep 17, 2026
@andig
andig deleted the feat/continuity-anchor branch September 17, 2026 12:10
andig added a commit that referenced this pull request Sep 17, 2026
# Conflicts:
#	src/optimizer/optimizer.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant