Calculating loads and capacity

Smartlane offers a granular and variable way to define the loads of a shipment and matches these to the vehicle's capacity. Basically we have the data from the TMS (definition), a factor for the mapping to the load units (transformation) and the final result (optimization)

Define load dimensions

Customers are able to define three dimensions with Smartlane's customer success during the onboarding process. These can be for example

  • The number of pallet places
  • The weight and
  • RDS points
    Each defined with a name (dimension) and a unit, e.g. "Kg"

These will be referenced for deliveries and vehicles:

  • Deliveries: load, load_2, load_3

  • Vehicles: capacity_1, capacity_2, capacity_3

You can check the current settings with this call:

endpoint = "settings/LOAD_DIMENSIONS"
api_url = basic_url + endpoint

headers = {"Accept": "application/json", "Content-Type": "application/json", "Authorization": "JWT {}".format(token)}
response = requests.get(api_url, headers = headers)

The response returns the currently defined dimensions:

{
  "id": 1257,
  "key": "LOAD_DIMENSIONS",
  "value": "[
     {\"dimension\":\"Stellpl\u00e4tze\",\"unit\":\"Stellpl\u00e4tze\"},
     {\"dimension\":\"Gewicht\",\"unit\":\"kg\"},
     {\"dimension\":\"ADR\",\"unit\":\"Punkte\"}]"
}

In this example we defined "Stellplaetze" (number of pallets), "Gewicht" (weight) and "ADR" (dangerous goods points).
Make sure you consider these in exactly this order. E.g. in your delivery data:

"deliverydata": [
          {
               "country": "DE",
               "fixed_els_seconds": 120,
               "liftgate_needed": false,
               "trailer_needed": false,
               "adr_needed": false,
               "load": 1,
               "load_2": 1,
               "load_3": 1,
               "final": false,
               "notify_customer_email": false,
               "notify_customer_sms": false
          }

or in the array of the items property:

"items": [
     {
        ....
         "loads": [
            0,
            0,
            0
         ], ...
    }
]

Define load units (for transformation)

In order to map the loads of a shipment in the defined dimensions, you can define load_units which defines a factor with regard to the dimension.
Example: A standard EU pallet has the dimension 1.200 mm × 800 mm (length x width).

📘

Example

  1. Your shipment has the size 800 x 700 cm which is 0.58 times the standard pallet. So the required pallet place is 1 pallet. Shipments with this dimensions have the key "EX"
  2. Your shipment has the size 1800 x 700 cm which is 1.31 times the standard pallet. So the required pallet place is 2 pallets. Shipments with this dimensions have the key "EY"

You can add these keys to the Smartlane services using the endpoint loadunits endpoint. In the following example we only add a factor for the pallet places. If you would like to consider all load units, add a factor for each load unit (in our example pallet place, weight and RDS points).

import requests

url = "https://customer_id.prd.smartlane.io/api/loadunits"

headers = {
    "Accept": "application/json",
    "Content-Type": "application/json"
}

load_unit = {
    "description": "Map EX key to 1.5 pallet places",
    "name": "EX pallet places",
    "load_factors":[1.5, 0, 0],
    "key": "EX"
}
body = json.dumps(load_unit)

response = requests.post(api_url, headers = headers, data = body)

print(response.text)

Map shipment loads to vehicle capacity

Now you have the mapping key and the factor for transformation defined and our algorithm will be able to match the load of shipments to the capacity of the vehicles using the "currency" that we defined in the dimensions.

Width and length

If no values are set for the delivery.load* that defines the pallet places, we consider the width and length settings in order to calculate the required area and reference it to the standard pallet place defined in the config.
E.g. width = 700mm

Considering load units for shipment items

If a shipments consists of several items you can define the load units per item. In this case use the items array in order to define loads and leave the parent properties of the delivery object empty.
These are empty:

      "load": 0,
      "load_2": 0,
      "load_3": 0, ...

      ....
     "weight": 30,
      "length": 100

These will be considered for the load calculation:

"items": [
                {
                    "load_unit_key": "PT",
                    "load_unit_amount": "1",
                    "loads": [
                        0,
                        0,
                        0
                    ],
                    "length": 100,
                    "width": 200
                },
                {
                    "load_unit_key": "PT",
                    "load_unit_amount": "1",
                    "loads": [
                        11,
                        0,
                        0
                    ],
,
                    "length": 100,
                    "width": 200
                }
            ],

You can fetch the final calculated values for loads from the effective_loads in the GET /api/route call as an array of integers: getroute.

📘

Dispatch rules override load units!

Please be aware that we process dispatch rules after load units. If dispatch rules also affect load units, they will override the manipulations defined by the load units.