PRICE-02 review: keep an open buy over midnight in the real-year replay; say which variant the kWh figure is
checks / unit (pull_request) Successful in 47m40s
infra-pin / fresh (pull_request) Successful in 1s

The production-shaped plan sees tomorrow from 13:00, so most buys are sold
the next day or later. The ledger forgot the open buy at each midnight and
booked 46 of 51 sales as holdings: 5 trips, +1.21 EUR. Carried over, the
same decisions give 51 trips, +13.81 EUR, all clearing the threshold.
Decisions are unchanged and identical on the old and new verdict. No
assertion changed.

DECISIONS: 27.5 -> 42.6 kWh is the refresh-:00, tomorrow-known variant; give
the range of the other three.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bdqr7PiaHcBnzPituu2yTC
This commit is contained in:
glenn schrooyen
2026-10-22 16:48:43 +02:00
co-authored by Claude Opus 5.5
parent 3dd4dd89e0
commit 6b2d0091d6
2 changed files with 8 additions and 4 deletions
@@ -80,8 +80,10 @@ tested the first of them only because its plan began at midnight.
On real 15-minute days the trade runs longer: about 1.5 to 2.5 times the On real 15-minute days the trade runs longer: about 1.5 to 2.5 times the
minutes spent charging or discharging, with fewer on/off switches (for example minutes spent charging or discharging, with fewer on/off switches (for example
78 -> 68, 92 -> 72). Through a modelled 10 kWh battery that is 27.5 -> 42.6 kWh 78 -> 68, 92 -> 72), over 16 days (2026-09-02 to 09-17, a decision every
over 16 days (2026-09-02 to 09-17, a decision every minute, refresh at :00 or minute, refresh at :00 or :10, tomorrow's prices known always or from 13:00;
:10, tomorrow's prices known always or from 13:00; reviewer's sim). Charge to reviewer's sim). Through a modelled 10 kWh battery that is 27.5 -> 42.6 kWh
(refresh at :00, tomorrow always known); 19.6-31.9 -> 43.4-48.7 kWh in the
other three variants. Charge to
discharge reversals are unchanged (10 -> 10, 13 -> 13). More cycling is the discharge reversals are unchanged (10 -> 10, 13 -> 13). More cycling is the
price of not pausing. price of not pausing.
+3 -1
View File
@@ -2093,12 +2093,14 @@ def replay_real(days, threshold, unc, *, soc0=50.0, floor=20.0, ceiling=95.0):
it and never a day on its own. (An earlier version built one plan per it and never a day on its own. (An earlier version built one plan per
calendar day with no tomorrow: after the cheap hour no cheap hour was left calendar day with no tomorrow: after the cheap hour no cheap hour was left
ahead, and the ledger shrank to a few trades that no real site would see.) ahead, and the ledger shrank to a few trades that no real site would see.)
An open buy is kept over midnight: with tomorrow in view most buys are
sold the next day or later (46 of 51 at the shipped threshold).
""" """
soc = soc0 soc = soc0
trades, holdings, bad, neg_sells = [], [], [], 0 trades, holdings, bad, neg_sells = [], [], [], 0
open_buy = None
for di, day in enumerate(days): for di, day in enumerate(days):
nxt = days[di + 1] if di + 1 < len(days) else [] nxt = days[di + 1] if di + 1 < len(days) else []
open_buy = None
for i, p in enumerate(day): for i, p in enumerate(day):
ahead = day[i:] + (nxt if brussels(p.start).hour >= 13 else []) ahead = day[i:] + (nxt if brussels(p.start).hour >= 13 else [])
plan = TariffPlan( plan = TariffPlan(