feat: paller — 'fuldt læs' for autoload-bil = mindst 4 paller klar (ved spawner eller i objektlager) (v1.12.14.0)

This commit is contained in:
2026-09-23 15:30:51 +02:00
parent 2714d11ab8
commit b6c729ac59
7 changed files with 46 additions and 13 deletions
+2 -1
View File
@@ -419,11 +419,12 @@ check("O18 reserve spørges ikke for lager-politik", demandCalls[#demandCalls] ~
local v19 = newVehicle("Dragon", 0, 0, 6000, true)
v19.carriable = {}
runs[v19] = outboundRun(19, {1}, {{fillType = "SUGAR", policy = "sell"}})
products[1] = {{fillType = SUGAR, name = "SUGAR", available = 150000, level = 150000, capacity = 180000, isPallet = false, canPallet = true, palletLiters = 3000}}
products[1] = {{fillType = SUGAR, name = "SUGAR", available = 150000, level = 150000, capacity = 180000, isPallet = false, canPallet = true, palletLiters = 3000, palletCount = 3}}
quotes["selling station"][SUGAR].percent = 92
local input19 = ADOutbound.buildPlanInput(adEnv, runs[v19], v19)
check("O19 varen tages som paller", input19.products[1] ~= nil and input19.products[1].isPallet, true)
check("O19 mængde = paller ved spawner", input19.products[1].sources[1].available, 3000)
check("O19 palle-antal følger med", input19.products[1].sources[1].palletCount, 3)
local v19b = newVehicle("Tipvogn", 0, 0, 20000)
runs[v19b] = outboundRun(20, {1}, {{fillType = "SUGAR", policy = "sell"}})
local input19b = ADOutbound.buildPlanInput(adEnv, runs[v19b], v19b)
+14
View File
@@ -130,5 +130,19 @@ check("P13 lager rører ikke reserven", P.plan(input({storeReserve})).kind, "sto
local e13 = P.evaluate(withReserve, input({}, {capacity = 20000}))
check("P13 evaluate sellable", e13.sellable, 268000)
-- P14 (paller): kapacitet ukendt for en autoload-bil -> "fuldt læs" = mindst PALLET_FULL_LOAD_COUNT paller klar
local function palletInput(products)
local inp = input(products, {hasAutoload = true})
inp.capacity = nil
return inp
end
local palletProduct = product("STRAW_BASKET", BASKET, "store", {{wayPointId = 5, available = 3000, level = 1600, capacity = 8000, palletCount = 3}}, nil, storeSilo, true)
check("P14 3 paller: ikke fuldt læs", P.plan(palletInput({palletProduct})), nil)
palletProduct.sources[1].palletCount = 4
check("P14 4 paller: lager-tur", P.plan(palletInput({palletProduct})).kind, "store")
local twoSources = product("STRAW_BASKET", BASKET, "store", {{wayPointId = 5, available = 2000, level = 1600, capacity = 8000, palletCount = 2}, {wayPointId = 3, available = 2000, level = 2, capacity = 4000, palletCount = 2}}, nil, storeSilo, true)
check("P14 paller summeres over kilder", P.plan(palletInput({twoSources})).kind, "store")
check("P14 evaluate palletCount", P.evaluate(twoSources, palletInput({})).palletCount, 4)
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)
+2
View File
@@ -157,6 +157,8 @@ addPallet(BASKET, 1000, 160, 100) -- 50 m væk: tæller ikke
addPallet(BASKET, 1000, 112, 102, 2) -- anden farm: tæller ikke
local products4 = ADSources.getProducts(adEnv, source1, 1)
check("S4 paller ved spawner", products4[2].available, 2000)
check("S4 antal paller ved spawner", products4[2].palletCount, 2)
check("S3 antal paller i objektlager", products3[1].palletCount, 8)
check("S4 bulk uændret", products4[1].available, 150000)
addPallet(SUGAR, 2000, 111, 101)
local products4b = ADSources.getProducts(adEnv, source1, 1)