This feature is configurable via .json
input, without the need for code customization and is available for both the Marketplace app and Platform. You can find a list of all available features here.
This how-to guide assumes you already completed the get started with vehicle routing tutorial.
Field name | Required | Data type | SI Unit | Defined on | Example | Configurable via defaults |
---|---|---|---|---|---|---|
capacity | No | object (string to float ) or float | NA | vehicle | {"capacity": {"bar": 2.0}} | ✅ |
start_level | No | object (string to float ) or float | NA | vehicle | {"start_level": {"bar": 2.0}} | ✅ |
quantity | No | object (string to float ) or float | NA | stop | {"quantity": -1.0} | ✅ |
If your vehicles need to transport something but have limited capacity, you need to use the following attributes of the input:
capacity
on vehiclesquantity
on stops
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 capacity
can be:
- a single
float
value for specifying a single dimension of capacity. - a map of
string
tofloat
values, when defining multiple dimensions that need to be considered.
You can also define the start_level
of the vehicle's capacity, which can be different than zero. This is useful when you want to model a vehicle that starts with a certain amount (level) of capacity already used. Similar to the capacity
, it can be defined as a single float
value or a map of string
to float
values.
quantity
defines how much a vehicle's capacity changes at a stop:
- A negative (-)
quantity
consumes some of the available capacity and raises the level on the resource by thequantity
at a stop (pickup operation), - A positive (+)
quantity
defines how much is replenished / returned (dropoff operation).
The quantity
is defined on the individual stop (or globally in the defaults.stops
section). In the same way as capacity
, it can be defined as a single float
value or a map of string
to float
values. You should only include positive quantity stops if it complements a negative quantity.
Here is an example input defining both types of capacities and quantities on vehicles and stops, respectively. A sample output obtained after solving the problem is also shown.
Quantities of different dimensions do not count towards the same capacity, e.g., pallets and bins are capacitated independently of each other.