Run a real packing request before you write any code.
This page executes @packvium/engine on the server and draws the placements it returns. Change the objective or a quantity and the answer, the score vector and the refusals all come from the engine. Nothing on this page is a mock-up.
Each scenario is a complete request the site already checks against the engine. Picking one opens it in Advanced mode and runs it: edit it, run it again, and take the code below the result.
Opens as few containers as it can, then packs them as tightly as it can.
Up to 40 per item.
crate · 400×300×200case · 300×200×150carton · 200×150×15018 of 200 units
small · 600×400×400×4120large · 1200×800×600×2260- Units left over0
- Containers opened1
- Container costin minor currency units260
- Unused volumeparts per million, added up over the containers677 083
- Stack heightparts per million of container height, added up500 000
Compared in this order: the lower number wins, and only a tie hands the decision to the next line.
Container cost: the best possible answer has at least 120, this one has 260 - at most 140 above the best. That excess is 117% of the bound.
The reference validator found no issues with this result.
@packvium/browser 1.11.0, which shares no code with the engine that packed it.The same result as one document a warehouse system can use with no engine and no network. The server builds it from the result above; the three views below are made in your browser from that document alone.
Building the work order…
import json
from packvium import pack_from_dict
request = json.loads(r"""
{
"units": {
"length": "mm"
},
"configuration": {
"objective": "default",
"seed": 42,
"solver_profile": "balanced",
"time_limit_ms": 250,
"require_placement_coordinates": true
},
"items": [
{
"id": "crate",
"quantity": 4,
"dimensions": {
"length": 400,
"width": 300,
"height": 200
},
"weight": {
"value": "6",
"unit": "kg"
},
"keep_upright": false
},
{
"id": "case",
"quantity": 6,
"dimensions": {
"length": 300,
"width": 200,
"height": 150
},
"weight": {
"value": "3",
"unit": "kg"
},
"keep_upright": true
},
{
"id": "carton",
"quantity": 8,
"dimensions": {
"length": 200,
"width": 150,
"height": 150
},
"weight": {
"value": "1.5",
"unit": "kg"
},
"keep_upright": false
}
],
"containers": [
{
"id": "small",
"inner_dimensions": {
"length": 600,
"width": 400,
"height": 400
},
"cost_minor": 120,
"quantity": 4,
"max_payload": {
"value": "80",
"unit": "kg"
}
},
{
"id": "large",
"inner_dimensions": {
"length": 1200,
"width": 800,
"height": 600
},
"cost_minor": 260,
"quantity": 2,
"max_payload": {
"value": "300",
"unit": "kg"
}
}
]
}
""")
result = pack_from_dict(request)
print(result["status"])
for unpacked in result["unpacked_items"]:
print(unpacked["item_id"], unpacked["reason"])