Capacity¶
Info
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.
| 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:
capacityon vehiclesquantityon 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
floatvalue for specifying a single dimension of capacity. - a map of
stringtofloatvalues, 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 (-)
quantityconsumes some of the available capacity and raises the level on the resource by thequantityat a stop (pickup operation), - A positive (+)
quantitydefines 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.
{
"defaults": {
"vehicles": {
"speed": 20
}
},
"stops": [
{
"id": "Fushimi Inari Taisha",
"location": { "lon": 135.772695, "lat": 34.967146 },
"quantity": -1
},
{
"id": "Kiyomizu-dera",
"location": { "lon": 135.78506, "lat": 34.994857 },
"quantity": -1
},
{
"id": "Nijō Castle",
"location": { "lon": 135.748134, "lat": 35.014239 },
"quantity": -1
},
{
"id": "Kyoto Imperial Palace",
"location": { "lon": 135.762057, "lat": 35.025431 },
"quantity": {
"pallets": -1,
"bins": 1
}
},
{
"id": "Gionmachi",
"location": { "lon": 135.775682, "lat": 35.002457 },
"quantity": {
"pallets": -1,
"bins": -1
}
},
{
"id": "Kinkaku-ji",
"location": { "lon": 135.728898, "lat": 35.039705 },
"quantity": {
"pallets": -1,
"bins": -1
}
},
{
"id": "Arashiyama Bamboo Forest",
"location": { "lon": 135.672009, "lat": 35.017209 },
"quantity": {
"pallets": -1,
"bins": 1
}
}
],
"vehicles": [
{
"id": "v1",
"capacity": 3,
"start_level": 0,
"start_location": { "lon": 135.772695, "lat": 34.967146 }
},
{
"id": "v2",
"capacity": {
"pallets": 4,
"bins": 2
},
"start_level": {
"pallets": 0,
"bins": 0
},
"start_location": { "lon": 135.728898, "lat": 35.039705 }
}
]
}
{
"options": {
"check": {
"duration": 30000000000,
"verbosity": "off"
},
"format": {
"disable": {
"progression": true
}
},
"model": {
"constraints": {
"disable": {
"attributes": false,
"capacities": null,
"capacity": false,
"distance_limit": false,
"groups": false,
"maximum_duration": false,
"maximum_stops": false,
"maximum_wait_stop": false,
"maximum_wait_vehicle": false,
"mixing_items": false,
"precedence": false,
"start_time_windows": false,
"vehicle_end_time": false,
"vehicle_start_time": false
},
"enable": {
"cluster": false
}
},
"objectives": {
"capacities": "",
"cluster": 0,
"distance": 0,
"early_arrival_penalty": 1,
"late_arrival_penalty": 1,
"min_stops": 1,
"stop_balance": 0,
"travel_duration": 0,
"unplanned_penalty": 1,
"vehicle_activation_penalty": 1,
"vehicles_duration": 1
},
"properties": {
"disable": {
"duration_groups": false,
"durations": false,
"initial_solution": false,
"stop_duration_multipliers": false
},
"maximum_time_horizon": 15552000
},
"validate": {
"disable": {
"resources": false,
"start_time": false
},
"enable": {
"matrix": false,
"matrix_asymmetry_tolerance": 20
}
}
},
"solve": {
"duration": 10000000000,
"iterations": 50,
"parallel_runs": 1,
"plateau": {
"absolute_threshold": -1,
"delay": 0,
"duration": 0,
"iterations": 0,
"relative_threshold": 0
},
"run_deterministically": true,
"solver": {
"plan_group_size": {
"delta": 0,
"delta_after_iterations": 1000000000,
"max_value": 2,
"min_value": 2,
"snap_back_after_improvement": true,
"start_value": 2,
"zigzag": true
},
"unplan_units": {
"delta": 2,
"delta_after_iterations": 125,
"max_value": -1,
"min_value": 2,
"snap_back_after_improvement": true,
"start_value": 2,
"zigzag": true
},
"unplan_weights": "Vehicle:3,Island:1,Location:293"
},
"start_solutions": 1
}
},
"solutions": [
{
"objective": {
"name": "1 * vehicles_duration + 1 * unplanned_penalty",
"objectives": [
{
"base": 1155.4805543604316,
"factor": 1,
"name": "vehicles_duration",
"value": 1155.4805543604316
},
{
"factor": 1,
"name": "unplanned_penalty",
"value": 0
}
],
"value": 1155.4805543604316
},
"unplanned": [],
"vehicles": [
{
"id": "v1",
"route": [
{
"cumulative_travel_duration": 0,
"stop": {
"id": "v1-start",
"location": {
"lat": 34.967146,
"lon": 135.772695
}
},
"travel_duration": 0
},
{
"cumulative_travel_duration": 0,
"stop": {
"id": "Fushimi Inari Taisha",
"location": {
"lat": 34.967146,
"lon": 135.772695
}
},
"travel_duration": 0
},
{
"cumulative_travel_distance": 3280,
"cumulative_travel_duration": 164,
"stop": {
"id": "Kiyomizu-dera",
"location": {
"lat": 34.994857,
"lon": 135.78506
}
},
"travel_distance": 3280,
"travel_duration": 164
},
{
"cumulative_travel_distance": 7274,
"cumulative_travel_duration": 363,
"stop": {
"id": "Nijō Castle",
"location": {
"lat": 35.014239,
"lon": 135.748134
}
},
"travel_distance": 3994,
"travel_duration": 199
}
],
"route_duration": 363,
"route_travel_distance": 7274,
"route_travel_duration": 363
},
{
"id": "v2",
"route": [
{
"cumulative_travel_duration": 0,
"stop": {
"id": "v2-start",
"location": {
"lat": 35.039705,
"lon": 135.728898
}
},
"travel_duration": 0
},
{
"cumulative_travel_duration": 0,
"stop": {
"id": "Kinkaku-ji",
"location": {
"lat": 35.039705,
"lon": 135.728898
}
},
"travel_duration": 0
},
{
"cumulative_travel_distance": 3410,
"cumulative_travel_duration": 170,
"stop": {
"id": "Kyoto Imperial Palace",
"location": {
"lat": 35.025431,
"lon": 135.762057
}
},
"travel_distance": 3410,
"travel_duration": 170
},
{
"cumulative_travel_distance": 6249,
"cumulative_travel_duration": 312,
"stop": {
"id": "Gionmachi",
"location": {
"lat": 35.002457,
"lon": 135.775682
}
},
"travel_distance": 2839,
"travel_duration": 141
},
{
"cumulative_travel_distance": 15832,
"cumulative_travel_duration": 791,
"stop": {
"id": "Arashiyama Bamboo Forest",
"location": {
"lat": 35.017209,
"lon": 135.672009
}
},
"travel_distance": 9583,
"travel_duration": 479
}
],
"route_duration": 791,
"route_travel_distance": 15832,
"route_travel_duration": 791
}
]
}
],
"statistics": {
"result": {
"custom": {
"activated_vehicles": 2,
"max_duration": 0.123,
"max_stops_in_vehicle": 4,
"max_travel_duration": 0.123,
"min_duration": 0.123,
"min_stops_in_vehicle": 3,
"min_travel_duration": 0.123,
"unplanned_stops": 0
},
"duration": 0.123,
"value": 0.123
},
"run": {
"duration": 0.123,
"iterations": 50
},
"schema": "v1"
},
"version": {
"sdk": "VERSION"
}
}
Info
Quantities of different dimensions do not count towards the same capacity, e.g., pallets and bins are capacitated independently of each other.