Skip to content

Capacity

Capacity

You can restrict how much a vehicle can hold using Size and Capacity

This is often used for:

  • Setting a total weight limit (in KGs, Tonnes, LBs, etc) for items in a vehicle
  • Setting a total size limit (in m3, litres, etc) for items in a vehicle
  • Restricting the number of items (pallets, trolleys, boxes, crates) in a vehicle
  • Restricting the number of passengers in a vehicle
  • Restricting the total number of stops a Driver can do
  • Combining several of the above constraints

You can use this constraint by setting the capacity on a Driver and the size on a Job

If any Job has a size property, then any Driver without a specified capacity will be assumed to have zero capacity for all dimensions.

Multi-shift

In a multi-shift request, reset empties the vehicle at the end of every Shift. continue keeps the load on the vehicle between Shifts.

Dimensions

We use the word Dimension to refer to each type of thing that you want to constrain.

For example: weight is a Dimension. volume is another Dimension. number of passengers is yet another Dimension.

Simple Capacity

If you only use one Dimension, you can use simple capacity. e.g. you want to constrain weight or volume, but not weight AND volume.

To use Simple Capacity, you should set the Job sizes and Driver capacitys to integers.

The optimiser is not aware of units (kilograms, grams, metres cubed, litres, etc). So you must use the same units for all values

Example

{
  "drivers": [
    {
      "uid": "driver_1",
      "shift_start": 8,
      "shift_end": 17,
      "start": {"lat": -33.867798, "lon": 151.166256},
      "end": "start",
      "capacity": 10
    }
  ],
  "jobs": [
    {
      "uid": "job_1",
      "duration": 2,
      "location": {"lat": -33.849489, "lon": 151.127482},
      "size": 3
    },
    {
      "uid": "job_2",
      "duration": 2,
      "location": {"lat": -33.880661, "lon": 151.183096},
      "size": 4
    },
    {
      "uid": "job_3",
      "duration": 2,
      "location": {"lat": -33.913168, "lon": 151.262267},
      "size": 6
    }
  ],
  "settings": {}
}

Multi-Dimension Capacity

If you want to constrain more than one Dimension, for example:

  • weight AND volume, or
  • seated passengers AND wheelchair passengers

then you should use Multi-Dimension Capacity.

Multi-Dimension Capacity is expressed in a DSL (Domain Specific Language):

  • Each Dimension name preceeds its value, separated by :
  • Dimensions are separated using &

for example: weight:7&volume:1300&pallets:26.

To use Multi-Dimension Capacity, you should

  1. Set the capacity on all Drivers for all Dimensions. A driver that can take up to 8 boxes and up to 3 pallets would have capacity boxes:8&pallets:3
  2. Set the size of each Job. A Job that is comprised of 1 box and no pallets would have size boxes:1&pallets:0

If a Dimension is omitted on a Driver, it is assumed that this Driver has 0 capacity for that Dimension.

Likewise, if a Dimension is omitted on a Job, it is assumed that this Job takes 0 size for that Dimension.

So boxes:1&pallets:0 is equivalent to boxes:1.

Example

{
  "drivers": [
    {
      "uid": "driver_1",
      "shift_start": 8,
      "shift_end": 17,
      "start": {"lat": -33.867798, "lon": 151.166256},
      "end": "start",
      "capacity": "pallets:9&boxes:10"
    }
  ],
  "jobs": [
    {
      "uid": "job_1",
      "duration": 2,
      "location": {"lat": -33.849489, "lon": 151.127482},
      "size": "pallets:1"
    },
    {
      "uid": "job_2",
      "duration": 2,
      "location": {"lat": -33.880661, "lon": 151.183096},
      "size": "pallets:3&boxes:5"
    },
    {
      "uid": "job_3",
      "duration": 2,
      "location": {"lat": -33.913168, "lon": 151.262267},
      "size": "pallets:5&boxes:2"
    }
  ],
  "settings": {}
}