vehicle
A vehicle
represents the physical vehicle being driven on a route.
The vehicle object contains details about the constraints and costs associated with driving the vehicle. The optimizer uses these details to determine which jobs can be serviced by the vehicle.
All vehicles must have an id
. See Routing with Vehicles.
Name | Type | Description |
---|---|---|
allow_ferries | boolean | If enabled, the driver can utilize ferries. Defaults to the value of settings.defaults.allow_ferries if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
allow_toll_roads | boolean | If enabled, the driver can make use of toll roads. Defaults to the value of settings.defaults.allow_toll_roads if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
allow_u_turns | boolean | If enabled, the driver can make u-turns. Is disabled if same_side_routing is enabled. Defaults to the value of settings.defaults.allow_u_turns if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
attributes | string[] | The attributes provided by this vehicle. Use with job.required_vehicle_attributes. See Routing with Attributes. |
cost_per_km | float | The number of US$ per kilometer driven. Used for optimization. Defaults to US$0.07677. |
custom | custom | User-supplied custom fields that are returned unmodified in the response. These have no effect on optimization. |
depot | depot or id | The depot where routes for this vehicle should start and end. Use instead of location if IDs are required. |
driving_speed_percentage | float | Percentage of the expected speed that the vehicle will be driven at. This is useful for taking into account heavy traffic. Stacks with route.driving_speed_percentage; for example, if a route and its vehicle both have a driving speed percentage of 50 , the overall speed for the route will be reduced to 25%. Defaults to 100 . |
fixed_cost | float | The number of US$ for using this vehicle. If a route that uses this vehicle is empty, this cost does not apply. Used for optimization. |
hazmat_load_type | hazmat_load_type | A comma-separated list of the types of hazardous material carried by this vehicle. Affects access to certain roads. Only applies when vehicle_type is truck . Defaults to the value of settings.defaults.hazmat_load_type. Requires Advanced Optimizer Settings. |
height_cm | float | The height of the vehicle, in centimeters. Affects access to certain roads. Defaults to the value of settings.defaults.height_cm if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
id | id | Unique ID of the vehicle. |
kingpin_to_axle_cm | float | The kingpin is the point at which the trailer in a tractor-trailer pair attaches to the tractor. This length represents the longest straight line of the vehicle. This gives an indication of the manuverablity of the vehicle and affects access to certain roads. Defaults to the value of settings.defaults.kingpin_to_axle_cm if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
length_cm | float | The length of the vehicle, in centimeters. Affects access to certain roads. Defaults to the value of settings.defaults.length_cm if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
load_capacities | load_amount[] | The total amount of loads that can be delivered by the vehicle, per metric, in one route. Metric names must not be duplicated in this list, and only up to four metric names may be used in a request. Omitted metrics indicate no limit. Not compatible with load_capacity. See Routing with Capacities. |
load_capacity | float | The total amount of load that can be delivered by the vehicle in one route. Not compatible with load_capacities. See Routing with Capacities. |
location | marker or id | The location where routes for this vehicle should start and end, or the id of a marker defined elsewhere in the request. |
max_jobs_on_route | integer | The maximum number of jobs the vehicle can service in one route. Useful for simple vehicle capacity planning. See Routing with Capacities. |
name | string | The name of the vehicle. |
number_of_axles | integer | The number of axles. This setting allows vehicles with more axles to carry more weight on some weight-restricted roads. Defaults to the value of settings.defaults.number_of_axles if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
number_of_trailers | integer | The number of trailers. Used to avoid roads with legal restrictions on vehicles with items in tow. Defaults to the value of settings.defaults.number_of_trailers if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
number_of_wheels | integer | The number of wheels. This setting allows vehicles with more wheels to carry more weight on some weight-restricted roads. Defaults to the value of settings.defaults.number_of_wheels if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
required_driver_attributes | string[] | The vehicle must be assigned to a route whose driver has all of these attributes. See Routing with Attributes. |
same_side_routing | boolean | If enabled, the driver must stop on the same side of the road as the job they are delivering to. Defaults to the value of settings.defaults.same_side_routing if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
time_on_site_at_end_location | timespan | The amount of time spent at the end location (for example, for unloading the vehicle). Defaults to the value of settings.defaults.time_on_site_at_end_location. |
time_on_site_at_return_to_depot | timespan | The amount of time spent at a return-to-depot (for example, for loading or unloading the vehicle). Defaults to the value of settings.defaults.time_on_site_at_return_to_depot. See Routing with Capacities. |
time_on_site_at_start_location | timespan | The amount of time spent at the start location (for example, for loading the vehicle). Defaults to the value of settings.defaults.time_on_site_at_start_location. |
unladen_weight_kg | float | The weight of the vehicle in kilograms when not carrying any load. Affects access to certain roads. Defaults to the value of settings.defaults.unladen_weight_kg if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
vehicle_type | string | The type of vehicle. Can be set to one of the following: car , truck , auto , straight_truck , standard_single_truck , standard_double_truck , intermediate_double_truck , long_double_truck or standard_triple_truck . The vehicle type affects access to certain roads. Defaults to settings.defaults.vehicle_type. Requires Advanced Optimizer Settings. |
width_cm | float | The width of the vehicle, in centimeters. Affects access to certain roads. Defaults to the value of settings.defaults.width_cm if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
weight_kg | float | The weight of the vehicle, in kilograms. Affects access to certain roads. Defaults to the value of settings.defaults.weight_kg if set, otherwise defaults to a value based on the vehicle_type. Requires Advanced Optimizer Settings. |
Example
{
"id": "vehicle0",
"location": "-43.549062, 172.642059",
"load_capacity": 150,
"vehicle_type": "truck"
}
Restrictions
Route Inline Vehicle Fields
If any vehicle objects have been provided with a request, the following fields cannot be supplied inline on any routes in the request:
- cost_per_km
- fixed_cost
- vehicle_type
- length_cm
- width_cm
- length_cm
- height_cm
- weight_kg
- unladen_weight_kg
- kingpin_to_axle_cm
- number_of_trailers
- number_of_wheels
- number_of_axles
- allow_toll_roads
- allow_u_turns
- allow_ferries
- same_side_routing
- hazmat_load_type
- max_jobs_on_route
- load_capacity
- load_capacities
- time_on_site_at_start_location
- time_on_site_at_return_to_depot
- time_on_site_at_end_location
See Also
- The route.vehicle field.
- The driver.vehicle field.
- Routing with Vehicles.