feat: v1.12.1.0 — prisregel via sæsonkurven, reserve til gårdens eget forbrug, paller til palleskur, fanen Lagre (idéer fra Distribution Redux)
This commit is contained in:
@@ -394,6 +394,25 @@ ADOutbound.beforeLoadUpdate(adEnv, task16, 100)
|
||||
ADOutbound.beforeLoadUpdate(adEnv, task16, 100)
|
||||
check("O16 næste spawn via fyldniveau", sources[3].spawnCalls, 2)
|
||||
|
||||
-- O17 (reserve + paller til lager): buildPlanInput henter reserve og palle-lager fra ADSources
|
||||
local demandCalls = {}
|
||||
ADSources.getFarmDemand = function(_, ft, farmId, excluded) table.insert(demandCalls, ft) return {liters = ft == SUGAR and 4000 or 0, consumers = {"TMR-fabrik"}} end
|
||||
local palletStoreMarker = nil
|
||||
ADSources.findPalletStore = function(_, vehicle, ft, excluded, isReachable, farmId) return palletStoreMarker end
|
||||
local v17 = newVehicle("Reserve", 0, 0, 20000)
|
||||
runs[v17] = outboundRun(17, {1}, {{fillType = "SUGAR", policy = "sell"}})
|
||||
local input17 = ADOutbound.buildPlanInput(adEnv, runs[v17], v17)
|
||||
check("O17 reserve på salgsvare", input17.products[1].reserve, 4000)
|
||||
check("O17 reserveret til", input17.products[1].reservedFor[1], "TMR-fabrik")
|
||||
local v18 = newVehicle("PalletStore", 100, 0, 8000, true)
|
||||
runs[v18] = outboundRun(18, {3}, {{fillType = "STRAW_BASKET", policy = "store"}})
|
||||
palletStoreMarker = {wayPointId = 40, name = "Palleskur", free = 100}
|
||||
sources[3].stored[BASKET] = 4
|
||||
products[3][1].available, products[3][1].level, products[3][1].capacity = 4000, 3900, 4000
|
||||
local input18 = ADOutbound.buildPlanInput(adEnv, runs[v18], v18)
|
||||
check("O18 palle-lager som store-mål", input18.products[1].store ~= nil and input18.products[1].store.wayPointId, 40)
|
||||
check("O18 reserve spørges ikke for lager-politik", demandCalls[#demandCalls] ~= BASKET, true)
|
||||
|
||||
-- O10: install wrapper: fejl i hook stopper ikke AD
|
||||
local calls = {}
|
||||
adEnv.LoadAtDestinationTask.update = function(self, dt) calls.update = (calls.update or 0) + 1 end
|
||||
|
||||
Reference in New Issue
Block a user