a dalsi oprava
This commit is contained in:
@@ -71,7 +71,7 @@ NEG_BUY_CHARGE_SHORTFALL_PENALTY_CZK_KWH = 100.0
|
||||
PRE_NEG_CHARGE_PENALTY_CZK_KWH = 400.0
|
||||
PRE_NEG_BATT_EXPORT_SHORTFALL_PENALTY_CZK_KWH = 80.0
|
||||
PRE_NEG_BATT_EXPORT_MIN_SELL_CZK_KWH = 1.0
|
||||
PLANNER_BUILD_TAG = "2026-05-29-neg-day-pv-headroom-v44"
|
||||
PLANNER_BUILD_TAG = "2026-05-29-neg-window-charge-night-v45"
|
||||
# Mimo evening_push: preferovat bd pro dům místo gi, když buy >> acq (účinná cena importu).
|
||||
NIGHT_SELF_CONSUME_IMPORT_SURCHARGE_CZK_KWH = 4.0
|
||||
# Po t_detach v prep: necpát PV do bat (měkké; tvrdý hold přes soc_target z rampy).
|
||||
@@ -1711,20 +1711,25 @@ def _evening_push_calendar_segments(
|
||||
|
||||
def _night_self_consume_discourage_import_indices(
|
||||
slots: list[PlanningSlot],
|
||||
evening_early_export_penalty_ts: set[int],
|
||||
*,
|
||||
evening_push_ts: set[int],
|
||||
charge_acquisition_czk_kwh: float,
|
||||
min_spread: float,
|
||||
) -> set[int]:
|
||||
"""
|
||||
Sloty mimo evening_push, kde import pro dům nahrazuje levnou zásobu z baterie.
|
||||
Noční sloty mimo evening_push: penalizace importu pro dům (preferovat bd).
|
||||
v45: celé noční okno, ne jen evening_early_export_ban subset.
|
||||
"""
|
||||
out: set[int] = set()
|
||||
for t in evening_early_export_penalty_ts:
|
||||
buy_t = float(slots[t].buy_price)
|
||||
for t, s in enumerate(slots):
|
||||
if t in evening_push_ts:
|
||||
continue
|
||||
if not _in_night_battery_export_window(s):
|
||||
continue
|
||||
buy_t = float(s.buy_price)
|
||||
if buy_t <= float(charge_acquisition_czk_kwh) + float(min_spread):
|
||||
continue
|
||||
if float(slots[t].load_baseline_w) <= 0:
|
||||
if float(s.load_baseline_w) <= 0:
|
||||
continue
|
||||
out.add(t)
|
||||
return out
|
||||
@@ -2532,7 +2537,7 @@ def solve_dispatch(
|
||||
)
|
||||
night_self_consume_discourage_ts = _night_self_consume_discourage_import_indices(
|
||||
slots,
|
||||
evening_early_export_penalty_ts,
|
||||
evening_push_ts=evening_push_ts,
|
||||
charge_acquisition_czk_kwh=charge_acquisition_czk_kwh,
|
||||
min_spread=float(degradation_cost_effective),
|
||||
)
|
||||
@@ -2785,7 +2790,7 @@ def solve_dispatch(
|
||||
cap_w = float(min(pv_surplus_w, battery.max_charge_power_w))
|
||||
sf_pv = pulp.LpVariable(f"post_neg_pv_shortfall_{t}", 0, cap_w)
|
||||
pv_charge_shortfall.append((t, sf_pv, cap_w))
|
||||
if neg_sell_phases_en:
|
||||
if neg_sell_phases_en and not relaxed_neg_prep_window:
|
||||
for t_ns in range(T):
|
||||
phase_ns = neg_sell_phase_by_t[t_ns]
|
||||
tgt_ns = neg_sell_soc_target_by_t[t_ns]
|
||||
|
||||
Reference in New Issue
Block a user