MAINT-28 fix-forward round 3: the cap is the guard's largest claim of the period, 0 W for a pack the guard does not place on
test_maint28 quarter bound back to aim + 1 W (now 5925 W; the guard alone landed 5960.1 W): the pack's limit is the largest floor the guard claimed in the 15-minute period. A pack in peak_guard.held (the guard places its claim on the others) gets 0 W. test_safety84 n2_charge_banked re-pinned again, its banked quarters asserted under the aim. New test: guard claims on the other pack only. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
776b84ca20
commit
fb4a449591
@@ -589,14 +589,25 @@ class CycleMixin:
|
||||
"suspended so the peak claim is not "
|
||||
"contradicted",
|
||||
hint=messages.hint("maint_paused"))
|
||||
# MAINT-28: while held this pack gives only what the
|
||||
# guard claims. DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md
|
||||
shape = ((max((c.lo for c in claims
|
||||
if c.source == peakguard.SOURCE),
|
||||
default=0.0), "peak hold")
|
||||
# MAINT-28: while held this pack gives at most the most the
|
||||
# guard claimed this period (0 W under its reserve: the
|
||||
# guard places its claim on the other packs).
|
||||
# DECISIONS/MAINT-28-hold-the-pause-in-a-peak.md
|
||||
_q = int(now.timestamp() // 900)
|
||||
if self._m28_q != _q:
|
||||
self._m28_q, self._m28_hi = _q, 0.0
|
||||
if self.peak_guard is None or \
|
||||
inv.name not in self.peak_guard.held:
|
||||
self._m28_hi = max(self._m28_hi, max(
|
||||
(c.lo for c in claims
|
||||
if c.source == peakguard.SOURCE), default=0.0))
|
||||
shape = ((0.0 if self.peak_guard is not None
|
||||
and inv.name in self.peak_guard.held
|
||||
else self._m28_hi, "peak hold")
|
||||
if _m28 else None)
|
||||
else:
|
||||
self._maint_shape_suspended = False
|
||||
self._m28_hi = 0.0
|
||||
hi = 0.0
|
||||
reason = "charge-only"
|
||||
if self.cheap:
|
||||
|
||||
Reference in New Issue
Block a user