load_amount
A load_amount
object is a quantity of some user-defined metric that represents either a route's capacity or a job's load.
Using load_amount
enables the use of multiple capacity metrics. Note that this cannot be used in conjunction with route.load_capacity
and job.load
.
Name | Type | Description |
---|---|---|
amount | float | Required. The amount of the metric. Represents either a route's capacity or the job's load. When specifying a load for a job you may use a negative amount to represent a load needing to be picked up. A positive amount represents a delivery. |
metric | capacity_metric or id | Required. The metric the load is measured in. See Routing with Capacities. Up to four different metrics can be used in a single request. |
Example
The following evaluate request demonstrates several details when using multiple load capacities with load_amount
:
{
"routes": [
{
"id": "route0_route_with_several_load_capacities",
"location": "39.718005, -104.969531",
"load_capacities": [
{ "metric": "weight_kg", "amount": 200 },
{ "metric": "volume_liters", "amount": 500 }
],
"jobs": [
{ "id": "job0", "location": "39.635928, -105.049219", "loads": [{ "metric": "weight_kg", "amount": 20 }, { "metric": "volume_liters", "amount": 60 }] },
{ "id": "job1", "location": "39.725375, -104.791080" },
{ "id": "job2", "location": "39.708990, -105.026954", "loads": [{ "metric": "volume_liters", "amount": 60 }, { "metric": "metric_without_a_limit", "amount": 1 }] },
{ "id": "job3", "location": "39.653975, -105.093750", "loads": [] }
]
}
]
}
This request returns a result with no load violations. It uses three user-defined metrics (out of a maximum 4):
weight_kg
.volume_liters
.metric_without_a_limit
.
The route defines two limits: one for weight_kg
and one for volume_liters
. The load metric metric_without_a_limit
is not specified on the route,
so has no limit.
The loads on the jobs may include fewer or more metrics than the routes that they can be routed on. If a particular metric is not specified on a job, it is taken to have
an amount of 0
.
See Also
- Routing with Capacities.
- The route.load_capacities field.
- The job.loads field.