Resource: Vehicle
Models a vehicle in a shipment problem. Solving a shipment problem will build a route starting from startLocation
and ending at endLocation
for this vehicle. A route is a sequence of visits (see ShipmentRoute
).
JSON representation |
---|
{ "name": string, "displayName": string, "travelMode": enum ( |
Fields | |
---|---|
name |
The resource name of the vehicle. This is a unique identifier. Format: |
displayName |
The user-defined display name of the vehicle. It can be up to 63 characters long and may use UTF-8 characters. |
travelMode |
The travel mode which affects the roads usable by the vehicle and its speed. See also |
routeModifiers |
Optional. A set of conditions to satisfy that affect the way routes are calculated for the given vehicle. |
startLocation |
Geographic location where the vehicle starts before picking up any shipments. If not specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, |
startWaypoint |
Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither |
endLocation |
Geographic location where the vehicle ends after it has completed its last |
endWaypoint |
Waypoint representing a geographic location where the vehicle ends after it has completed its last |
startTags[] |
Specifies tags attached to the start of the vehicle's route. Empty or duplicate strings are not allowed. |
endTags[] |
Specifies tags attached to the end of the vehicle's route. Empty or duplicate strings are not allowed. |
startTimeWindows[] |
Time windows during which the vehicle may depart its start location. They must be within the global time limits (see Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order.
|
endTimeWindows[] |
Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see Time windows belonging to the same repeated field must be disjoint, i.e. no time window can overlap with or be adjacent to another, and they must be in chronological order.
|
unloadingPolicy |
Unloading policy enforced on the vehicle. |
loadLimits |
Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the |
costPerHour |
Vehicle costs: all costs add up and must be in the same unit as Cost per hour of the vehicle route. This cost is applied to the total time taken by the route, and includes travel time, waiting time, and visit time. Using |
costPerTraveledHour |
Cost per traveled hour of the vehicle route. This cost is applied only to travel time taken by the route (i.e., that reported in |
costPerKilometer |
Cost per kilometer of the vehicle route. This cost is applied to the distance reported in the |
fixedCost |
Fixed cost applied if this vehicle is used to handle a shipment. |
usedIfRouteIsEmpty |
This field only applies to vehicles when their route does not serve any shipments. It indicates if the vehicle should be considered as used or not in this case. If true, the vehicle goes from its start to its end location even if it doesn't serve any shipments, and time and distance costs resulting from its start --> end travel are taken into account. Otherwise, it doesn't travel from its start to its end location, and no |
routeDurationLimit |
Limit applied to the total duration of the vehicle's route. In a given |
travelDurationLimit |
Limit applied to the travel duration of the vehicle's route. In a given |
routeDistanceLimit |
Limit applied to the total distance of the vehicle's route. In a given |
extraVisitDurationForVisitType |
Specifies a map from visitTypes strings to durations. The duration is time in addition to If a visit request has multiple types, a duration will be added for each type in the map. |
breakRule |
Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle. |
label |
Specifies a label for this vehicle. This label is reported in the response as the |
ignore |
If true, If a shipment is performed by an ignored vehicle in If a shipment is performed by an ignored vehicle in |
routeCommitments |
The route execution state of the vehicle. This field is used in the stateful service only. |
breakRuleIndices[] |
Deprecated: No longer used. Indices in the As of 2018/03, at most one rule index per vehicle can be specified. |
capacities[] |
Deprecated: Use |
startLoadIntervals[] |
Deprecated: Use |
endLoadIntervals[] |
Deprecated: Use |
travelDurationMultiple |
Specifies a multiplicative factor that can be used to increase or decrease travel times of this vehicle. For example, setting this to 2.0 means that this vehicle is slower and has travel times that are twice what they are for standard vehicles. This multiple does not affect visit durations. It does affect cost if WARNING: Travel times will be rounded to the nearest second after this multiple is applied but before performing any numerical operations, thus, a small multiple may result in a loss of precision. See also |
TravelMode
Travel modes which can be used by vehicles.
These should be a subset of the Google Maps Platform Routes Preferred API travel modes, see: https://developers.google.com/maps/documentation/routes_preferred/reference/rest/Shared.Types/RouteTravelMode.
Enums | |
---|---|
TRAVEL_MODE_UNSPECIFIED |
Unspecified travel mode, equivalent to DRIVING . |
DRIVING |
Travel mode corresponding to driving directions (car, ...). |
WALKING |
Travel mode corresponding to walking directions. |
RouteModifiers
Encapsulates a set of optional conditions to satisfy when calculating vehicle routes. This is similar to RouteModifiers
in the Google Maps Platform API; see: https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.
JSON representation |
---|
{ "avoidTolls": boolean, "avoidHighways": boolean, "avoidFerries": boolean, "avoidIndoor": boolean } |
Fields | |
---|---|
avoidTolls |
Specifies whether to avoid toll roads where reasonable. Preference will be given to routes not containing toll roads. Applies only to motorized travel modes. |
avoidHighways |
Specifies whether to avoid highways where reasonable. Preference will be given to routes not containing highways. Applies only to motorized travel modes. |
avoidFerries |
Specifies whether to avoid ferries where reasonable. Preference will be given to routes not containing travel by ferries. Applies only to motorized travel modes. |
avoidIndoor |
Optional. Specifies whether to avoid navigating indoors where reasonable. Preference will be given to routes not containing indoor navigation. Applies only to the |
UnloadingPolicy
Policy on how a vehicle can be unloaded. Applies only to shipments having both a pickup and a delivery.
Other shipments are free to occur anywhere on the route independent of unloadingPolicy
.
Enums | |
---|---|
UNLOADING_POLICY_UNSPECIFIED |
Unspecified unloading policy; deliveries must just occur after their corresponding pickups. |
LAST_IN_FIRST_OUT |
Deliveries must occur in reverse order of pickups |
FIRST_IN_FIRST_OUT |
Deliveries must occur in the same order as pickups |
LoadLimit
Defines a load limit applying to a vehicle, e.g. "this truck may only carry up to 3500 kg". See loadLimits
.
JSON representation |
---|
{ "softMaxLoad": string, "costPerUnitAboveSoftMax": number, "startLoadInterval": { object ( |
Fields | |
---|---|
softMaxLoad |
A soft limit of the load. See |
costPerUnitAboveSoftMax |
If the load ever exceeds |
startLoadInterval |
The acceptable load interval of the vehicle at the start of the route. |
endLoadInterval |
The acceptable load interval of the vehicle at the end of the route. |
maxLoad |
The maximum acceptable amount of load. |
Interval
Interval of acceptable load amounts.
JSON representation |
---|
{ "min": string, "max": string } |
Fields | |
---|---|
min |
A minimum acceptable load. Must be ≥ 0. If they're both specified, |
max |
A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum load is unrestricted by this message. If they're both specified, |
DurationLimit
A limit defining a maximum duration of the route of a vehicle. It can be either hard or soft.
When a soft limit field is defined, both the soft max threshold and its associated cost must be defined together.
JSON representation |
---|
{ "maxDuration": string, "softMaxDuration": string, "quadraticSoftMaxDuration": string, "costPerHourAfterSoftMax": number, "costPerSquareHourAfterQuadraticSoftMax": number } |
Fields | |
---|---|
maxDuration |
A hard limit constraining the duration to be at most maxDuration. A duration in seconds with up to nine fractional digits, ending with ' |
softMaxDuration |
A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, A duration in seconds with up to nine fractional digits, ending with ' |
quadraticSoftMaxDuration |
A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined,
A duration in seconds with up to nine fractional digits, ending with ' |
costPerHourAfterSoftMax |
Cost per hour incurred if the
The cost must be nonnegative. |
costPerSquareHourAfterQuadraticSoftMax |
Cost per square hour incurred if the The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows:
The cost must be nonnegative. |
BreakRule
Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break is a contiguous period of time during which the vehicle remains idle at its current position and cannot perform any visit. A break may occur:
- during the travel between two visits (which includes the time right before or right after a visit, but not in the middle of a visit), in which case it extends the corresponding transit time between the visits,
- or before the vehicle start (the vehicle may not start in the middle of a break), in which case it does not affect the vehicle start time.
- or after the vehicle end (ditto, with the vehicle end time).
JSON representation |
---|
{ "breakRequests": [ { object ( |
Fields | |
---|---|
breakRequests[] |
Sequence of breaks. See the |
frequencyConstraints[] |
Several |
BreakRequest
The sequence of breaks (i.e. their number and order) that apply to each vehicle must be known beforehand. The repeated BreakRequest
s define that sequence, in the order in which they must occur. Their time windows (earliestStartTime
/ latestStartTime
) may overlap, but they must be compatible with the order (this is checked).
JSON representation |
---|
{ "earliestStartTime": string, "latestStartTime": string, "minDuration": string } |
Fields | |
---|---|
earliestStartTime |
Required. Lower bound (inclusive) on the start of the break. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
latestStartTime |
Required. Upper bound (inclusive) on the start of the break. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
minDuration |
Required. Minimum duration of the break. Must be positive. A duration in seconds with up to nine fractional digits, ending with ' |
FrequencyConstraint
One may further constrain the frequency and duration of the breaks specified above, by enforcing a minimum break frequency, such as "There must be a break of at least 1 hour every 12 hours". Assuming that this can be interpreted as "Within any sliding time window of 12h, there must be at least one break of at least one hour", that example would translate to the following FrequencyConstraint
:
{
minBreakDuration { seconds: 3600 } # 1 hour.
maxInterBreakDuration { seconds: 39600 } # 11 hours (12 - 1 = 11).
}
The timing and duration of the breaks in the solution will respect all such constraints, in addition to the time windows and minimum durations already specified in the BreakRequest
.
A FrequencyConstraint
may in practice apply to non-consecutive breaks. For example, the following schedule honors the "1h every 12h" example:
04:00 vehicle start
.. performing travel and visits ..
09:00 1 hour break
10:00 end of the break
.. performing travel and visits ..
12:00 20-min lunch break
12:20 end of the break
.. performing travel and visits ..
21:00 1 hour break
22:00 end of the break
.. performing travel and visits ..
23:59 vehicle end
JSON representation |
---|
{ "minBreakDuration": string, "maxInterBreakDuration": string } |
Fields | |
---|---|
minBreakDuration |
Required. Minimum break duration for this constraint. Nonnegative. See description of A duration in seconds with up to nine fractional digits, ending with ' |
maxInterBreakDuration |
Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of A duration in seconds with up to nine fractional digits, ending with ' |
RouteCommitments
Information about the vehicle's execution of a route to be used in constraining the solution ShipmentRoute
obtained from a re-optimization. In particular, specifies route start time (i.e., actual, not planned), actual past visit start times, and committed sequence of future visits.
JSON representation |
---|
{ "routeStartTime": string, "pastVisits": [ { object ( |
Fields | |
---|---|
routeStartTime |
The actual time when the vehicle started executing its route. This must only be specified if the vehicle has started its route. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
pastVisits[] |
Visits that the vehicle has actually started (not necessarily completed) in the past, including their |
nextVisits[] |
Visits that the vehicle is committed to doing next. These visits must not have |
Visit
Specifies a pickup or delivery visit of a particular Shipment
and, optionally, its startTime
, which should only be set if the visit has actually happened.
JSON representation |
---|
{ "shipmentName": string, "isPickup": boolean, "visitRequestIndex": integer, "startTime": string } |
Fields | |
---|---|
shipmentName |
The resource name of the shipment. |
isPickup |
If true, the visit corresponds to a pickup of a |
visitRequestIndex |
Index of |
startTime |
Leave unset for nextVisits. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
CapacityQuantityInterval
Deprecated: Use Vehicle.LoadLimit.Interval
instead.
JSON representation |
---|
{ "type": string, "minValue": string, "maxValue": string } |
Fields | |
---|---|
type |
|
minValue |
|
maxValue |
|
Methods |
|
---|---|
|
Creates a vehicle. |
|
Deletes a vehicle. |
|
Gets a vehicle. |
|
Lists the vehicles within a workspace. |
|
Updates a vehicle. |