fix infeasable na home-01
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user