feat: run-indstilling 'Kør hjem fra Wait under X %' (10–90, standard 50) i model, XML, Wait-regel og fane (v1.10.2.0)

This commit is contained in:
2026-09-23 01:47:42 +02:00
parent ef69347c55
commit 231d6a41d6
12 changed files with 98 additions and 6 deletions
+4 -3
View File
@@ -158,11 +158,12 @@ end
ADSupplyPlanner.WAIT_RETURN_FREE_FRACTION = 0.5
-- Kan den ventende køre hjem? Ja når hele resten passer, eller når målet er mindst
-- WAIT_RETURN_FREE_FRACTION tomt. capacity nil = kun hele resten tæller.
function ADSupplyPlanner.canUnloadRest(freeSpace, rest, capacity)
-- freeFraction tomt (standard WAIT_RETURN_FREE_FRACTION; run'ets "kør hjem under X %" =
-- freeFraction 1 - X/100). capacity nil = kun hele resten tæller.
function ADSupplyPlanner.canUnloadRest(freeSpace, rest, capacity, freeFraction)
local needed = rest
if capacity ~= nil and capacity > 0 then
needed = math.min(rest, capacity * ADSupplyPlanner.WAIT_RETURN_FREE_FRACTION)
needed = math.min(rest, capacity * (freeFraction or ADSupplyPlanner.WAIT_RETURN_FREE_FRACTION))
end
return freeSpace >= needed
end