Search…
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.)
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-08-24T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{
10
"id": "vehicle-1",
11
// Vehicle can carry 1000 kg weight and offers 15000 liter loading volume
12
"capacity": { "weight": 1000, "volume": 15000 }
13
},
14
{
15
"id": "vehicle-2",
16
// Vehicle can carry 400 kg weight and offers 600 liter loading volume
17
"capacity": { "weight": 400, "volume": 600 }
18
}
19
],
20
"stops": [
21
{
22
"id": "order-1-pickup",
23
"position": { "lon": 7.6129, "lat": 51.957 },
24
"precedes": "order-1-dropoff",
25
// order-1: transport items of 1000 kg weight with 400 liter volume
26
"quantity": { "weight": -1000, "volume": -400 }
27
},
28
{
29
"id": "order-1-dropoff",
30
"position": { "lon": 7.6166, "lat": 51.9635 },
31
"quantity": { "weight": 1000, "volume": 400 }
32
},
33
{
34
"id": "order-2-pickup",
35
"position": { "lon": 7.6258, "lat": 51.9624 },
36
"precedes": "order-2-dropoff",
37
// order-2: transport items of 200 kg weight with 100 liter volume
38
"quantity": { "weight": -200, "volume": -100 }
39
},
40
{
41
"id": "order-2-dropoff",
42
"position": { "lon": 7.6386, "lat": 51.9449 },
43
"quantity": { "weight": 200, "volume": 100 }
44
}
45
]
46
}
Copied!

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.
JSON
1
{
2
"defaults": {
3
"vehicles": {
4
"shift_start": "2021-08-24T09:00:00-06:00",
5
"speed": 10
6
}
7
},
8
"vehicles": [
9
{
10
"id": "vehicle-1",
11
"capacity": 50
12
},
13
{
14
"id": "vehicle-2",
15
"capacity": 100
16
}
17
],
18
"stops": [
19
{
20
"id": "order-1-pickup",
21
"position": { "lon": 7.6129, "lat": 51.957 },
22
"precedes": "order-1-dropoff",
23
"quantity": -25
24
},
25
{
26
"id": "order-1-dropoff",
27
"position": { "lon": 7.6166, "lat": 51.9635 },
28
"quantity": 25
29
},
30
{
31
"id": "order-2-pickup",
32
"position": { "lon": 7.6258, "lat": 51.9624 },
33
"precedes": "order-2-dropoff",
34
"quantity": -75
35
},
36
{
37
"id": "order-2-dropoff",
38
"position": { "lon": 7.6386, "lat": 51.9449 },
39
"quantity": 75
40
}
41
]
42
}
Copied!
Export as PDF
Copy link