fix infeasable na home-01
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-22 16:09:11 +02:00
parent 9cf7708909
commit 0c4de4e5b9
3 changed files with 54 additions and 2 deletions

View File

@@ -1311,7 +1311,16 @@ def solve_dispatch(
prob += z_export[t] == 0
# Ekonomické guardy: ceny v objective nestačí proti maskám / terminal SoC.
ref_buy_horizon = min(float(s.buy_price) for s in slots)
# Referenční buy jen z ne-záporných slotů: jinak jeden buy<0 v horizontu označí
# téměř všechny sloty jako „drahé“ (gi=0 pro dům) → Infeasible (home-01).
non_negative_buys = [
float(s.buy_price) for s in slots if float(s.buy_price) >= 0.0
]
ref_buy_horizon = (
min(non_negative_buys)
if non_negative_buys
else min(float(s.buy_price) for s in slots)
)
min_spread = float(degradation_cost_effective)
for t in range(T):
s = slots[t]
@@ -1339,6 +1348,7 @@ def solve_dispatch(
skip_pv_store_block = (
float(s.pv_b_forecast_w) > 0
and not getattr(grid, "block_export_on_negative_sell", False)
and sell_t < 0
)
if (
not allow_pre_neg_pv_export