You are viewing Nextmv legacy docs. ⚡️ Go to latest docs ⚡️

Features

Capacity

You will learn the basics of using vehicle capacities on cloud.

If your vehicles need to transport something but have limited capacity, quantity and capacity are very useful attributes. capacity defines how much of a certain type of commodity/thing a vehicle can carry at maximum. It is defined on the individual vehicle (or globally in the defaults/vehicles section). The quantity defines how much a vehicle's capacity changes at a stop:

  • a negative quantity reduces the available capacity by the quantity at a stop (pickup operation),
  • a positive quantity defines how much is replenished / returned (dropoff operation).

Naturally, only include positive quantity stops if it complements a negative quantity.

Although the number of stops can be limited per vehicle by setting -1 quantities to all of them, we recommend using the route limit functionality for improved performance.

Quantities of different dimensions do not count towards the same capacity, e.g., pallets and bins can be counted directly but may both consume the same shared space. If this is needed, they can be combined in a more abstract dimension like weight or volume.

The following example combines capacities with precedence relations to form pickup & delivery orders. In this case the vehicles need to transport items of particular size and weight. (Note that the items and units chosen are just an example, the capacity and quantity properties and values can be used in whatever way best matches your system.)

{
  "defaults": {
    "vehicles": {
      "shift_start": "2021-08-24T09:00:00-06:00",
      "speed": 10
    }
  },
  "vehicles": [
    {
      "id": "vehicle-1",
      // Vehicle can carry 1000 kg weight and offers 15000 liter loading volume
      "capacity": { "weight": 1000, "volume": 15000 }
    },
    {
      "id": "vehicle-2",
      // Vehicle can carry 400 kg weight and offers 600 liter loading volume
      "capacity": { "weight": 400, "volume": 600 }
    }
  ],
  "stops": [
    {
      "id": "order-1-pickup",
      "position": { "lon": 7.6129, "lat": 51.957 },
      "precedes": "order-1-dropoff",
      // order-1: transport items of 1000 kg weight with 400 liter volume
      "quantity": { "weight": -1000, "volume": -400 }
    },
    {
      "id": "order-1-dropoff",
      "position": { "lon": 7.6166, "lat": 51.9635 },
      "quantity": { "weight": 1000, "volume": 400 }
    },
    {
      "id": "order-2-pickup",
      "position": { "lon": 7.6258, "lat": 51.9624 },
      "precedes": "order-2-dropoff",
      // order-2: transport items of 200 kg weight with 100 liter volume
      "quantity": { "weight": -200, "volume": -100 }
    },
    {
      "id": "order-2-dropoff",
      "position": { "lon": 7.6386, "lat": 51.9449 },
      "quantity": { "weight": 200, "volume": 100 }
    }
  ]
}
Copy

Single capacity and quantity values

The prior method of specifying capacity and quantity as scalar values is still supported as an alternative to the object dictionary. A code example is shown below.

{
  "defaults": {
    "vehicles": {
      "shift_start": "2021-08-24T09:00:00-06:00",
      "speed": 10
    }
  },
  "vehicles": [
    {
      "id": "vehicle-1",
      "capacity": 50
    },
    {
      "id": "vehicle-2",
      "capacity": 100
    }
  ],
  "stops": [
    {
      "id": "order-1-pickup",
      "position": { "lon": 7.6129, "lat": 51.957 },
      "precedes": "order-1-dropoff",
      "quantity": -25
    },
    {
      "id": "order-1-dropoff",
      "position": { "lon": 7.6166, "lat": 51.9635 },
      "quantity": 25
    },
    {
      "id": "order-2-pickup",
      "position": { "lon": 7.6258, "lat": 51.9624 },
      "precedes": "order-2-dropoff",
      "quantity": -75
    },
    {
      "id": "order-2-dropoff",
      "position": { "lon": 7.6386, "lat": 51.9449 },
      "quantity": 75
    }
  ]
}
Copy

Page last updated

Go to on-page nav menu