Page 1 of 1

packBins endpoint - nondeterministic data for itemsNotPacked

Posted: Tue Sep 29, 2020 12:47 pm
by Dobos Ionut
Hello,

We had a problem using the following endpoint:
https://xserver2.cloud.ptvgroup.com/ser ... l/packBins

We have 2 requests with items that are over the bin's limit.
1st request adds 67 items, and returns 1 item not packed, resulting in a limit of 66 items
2nd request adds 100 items and returns 32 items, resulting in a limit of 68 items

All items and bins userd in these requests are identical. Below you can find the 2 payloads and responses:
1st request payload

Code: Select all

{
    "bins": [
        {
            "dimensions": {
                "x": 240,
                "y": 244,
                "z": 1360
            },
            "id": "Truck",
            "maximumWeightCapacity": 20000,
            "numberOfBins": 1
        }
    ],
    "items": [
        {
            "allowedOrientations": null,
            "dimensions": {
                "x": 120,
                "y": 80,
                "z": 120
            },
            "id": "A",
            "maximumSurfaceLoads": null,
            "numberOfItems": 67,
            "weight": 50
        }
    ]
}
1st request response

Code: Select all

{
    "$type": "PackedBinsResponse",
    "itemsNotPacked": [
        {
            "dimensions": {
                "x": 120,
                "y": 80,
                "z": 120
            },
            "id": "A",
            "numberOfItems": 1,
            "weight": 50
        }
    ],
    ...
}
2nd request payload

Code: Select all

{
    "bins": [
        {
            "dimensions": {
                "x": 240,
                "y": 244,
                "z": 1360
            },
            "id": "Truck",
            "maximumWeightCapacity": 20000,
            "numberOfBins": 1
        }
    ],
    "items": [
        {
            "allowedOrientations": null,
            "dimensions": {
                "x": 120,
                "y": 80,
                "z": 120
            },
            "id": "A",
            "maximumSurfaceLoads": null,
            "numberOfItems": 100,
            "weight": 50
        }
    ]
}
2nd request response

Code: Select all

{
    "$type": "PackedBinsResponse",
    "itemsNotPacked": [
        {
            "dimensions": {
                "x": 120,
                "y": 80,
                "z": 120
            },
            "id": "A",
            "numberOfItems": 32,
            "weight": 50
        }
    ],
    ...
}
Please let us know if there is something we're doing wrong on our part.

Best regards,
John

Re: packBins endpoint - nondeterministic data for itemsNotPa

Posted: Tue Sep 29, 2020 4:02 pm
by Bernd Welter
Hi John,

here's some feedback from one of our developers:
but I’m quite sure it is relative to the “focus” you/they want to use: PackBinsFocus

The default “focus” is BUILD_LAYERS ; i.e. means the algorithm will try to save space in the ‘height ‘ dimension.

So the algorithm will certainly choose to stack the items 3 per 3, because it looks like it will gave the best result.

But in this specific case, the best objective would certainly be ‘REDUCE_LOADING_METERS’.

I tried several testcase with this objective, and each time 68 items are placed (or less if there was less item in the request).

With the [..] project there was a lot of improvements implemented for this objective. Maybe some of these improvements should also be ‘re-used’ for the BUILD_LAYERS objective.

Now we should consider the real usecase of the customer. And first of all, what is his goal ? How many bins did he optimize?
As the algorithm is not exact ; there will certainly be some cases where it won’t find the best placement. But our goal is to give an optimal one, the fastest we can.
Please return to me with some more details 1:1 via the ticket.

Best regards,
Bernd