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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user