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
+6
View File
@@ -172,5 +172,11 @@ check("kæmpe rest: halv stald fri -> hjem", ADSupplyPlanner.canUnloadRest(15000
check("kæmpe rest: under halv stald fri -> vent", ADSupplyPlanner.canUnloadRest(100000, 700000, 300000), false)
check("ukendt kapacitet -> kun hele resten tæller", ADSupplyPlanner.canUnloadRest(100000, 700000, nil), false)
-- canUnloadRest med run-tærskel: "under 30 %" = fri >= 70 % af kapaciteten
check("tærskel 30 %: 60 % fri er ikke nok", ADSupplyPlanner.canUnloadRest(60000, 90000, 100000, 0.7), false)
check("tærskel 30 %: 70 % fri er nok", ADSupplyPlanner.canUnloadRest(70000, 90000, 100000, 0.7), true)
check("hele resten passer vinder altid", ADSupplyPlanner.canUnloadRest(5000, 5000, 100000, 0.7), true)
check("uden tærskel = 50 %-reglen", ADSupplyPlanner.canUnloadRest(50000, 90000, 100000), true)
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)