- JSON representation
- Shipment
- VisitRequest
- LatLng
- Waypoint
- Location
- TimeWindow
- Vehicle
- TravelMode
- RouteModifiers
- UnloadingPolicy
- LoadLimit
- Interval
- DurationLimit
- DistanceLimit
- BreakRule
- BreakRequest
- FrequencyConstraint
- DurationDistanceMatrix
- Row
- TransitionAttributes
- ShipmentTypeIncompatibility
- IncompatibilityMode
- ShipmentTypeRequirement
- RequirementMode
- PrecedenceRule
A shipment model contains a set of shipments which must be performed by a set of vehicles, while minimizing the overall cost, which is the sum of:
- the cost of routing the vehicles (sum of cost per total time, cost per travel time, and fixed cost over all vehicles).
- the unperformed shipment penalties.
- the cost of the global duration of the shipments
JSON representation |
---|
{ "shipments": [ { object ( |
Fields | |
---|---|
shipments[] |
Set of shipments which must be performed in the model. |
vehicles[] |
Set of vehicles which can be used to perform visits. |
globalStartTime |
Global start and end time of the model: no times outside of this range can be considered valid. The model's time span must be less than a year, i.e. the When using A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
globalEndTime |
If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
globalDurationCostPerHour |
The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles. Users can assign a cost per hour to that quantity to try and optimize for earliest job completion, for example. This cost must be in the same unit as |
durationDistanceMatrices[] |
Specifies duration and distance matrices used in the model. If this field is empty, Google Maps or geodesic distances will be used instead, depending on the value of the Usage examples:
|
durationDistanceMatrixSrcTags[] |
Tags defining the sources of the duration and distance matrices; Tags correspond to |
durationDistanceMatrixDstTags[] |
Tags defining the destinations of the duration and distance matrices; Tags correspond to |
transitionAttributes[] |
Transition attributes added to the model. |
shipmentTypeIncompatibilities[] |
Sets of incompatible shipment_types (see |
shipmentTypeRequirements[] |
Sets of |
precedenceRules[] |
Set of precedence rules which must be enforced in the model. |
maxActiveVehicles |
Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive. |
Shipment
The shipment of a single item, from one of its pickups to one of its deliveries. For the shipment to be considered as performed, a unique vehicle must visit one of its pickup locations (and decrease its spare capacities accordingly), then visit one of its delivery locations later on (and therefore re-increase its spare capacities accordingly).
JSON representation |
---|
{ "displayName": string, "pickups": [ { object ( |
Fields | |
---|---|
displayName |
The user-defined display name of the shipment. It can be up to 63 characters long and may use UTF-8 characters. |
pickups[] |
Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries. |
deliveries[] |
Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups. |
loadDemands |
Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null. |
allowedVehicleIndices[] |
The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the |
costsPerVehicle[] |
Specifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:
These costs must be in the same unit as |
costsPerVehicleIndices[] |
Indices of the vehicles to which |
pickupToDeliveryAbsoluteDetourLimit |
Specifies the maximum absolute detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting
If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles. A duration in seconds with up to nine fractional digits, ending with ' |
pickupToDeliveryTimeLimit |
Specifies the maximum duration from start of pickup to start of delivery of a shipment. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. This does not depend on which alternatives are selected for pickup and delivery, nor on vehicle speed. This can be specified alongside maximum detour constraints: the solution will respect both specifications. A duration in seconds with up to nine fractional digits, ending with ' |
shipmentType |
Non-empty string specifying a "type" for this shipment. This feature can be used to define incompatibilities or requirements between Differs from |
label |
Specifies a label for this shipment. This label is reported in the response in the |
ignore |
If true, skip this shipment, but don't apply a Ignoring a shipment results in a validation error when there are any Ignoring a shipment that is performed in |
penaltyCost |
If the shipment is not completed, this penalty is added to the overall cost of the routes. A shipment is considered completed if one of its pickup and delivery alternatives is visited. The cost may be expressed in the same unit used for all other cost-related fields in the model and must be positive. IMPORTANT: If this penalty is not specified, it is considered infinite, i.e. the shipment must be completed. |
pickupToDeliveryRelativeDetourLimit |
Specifies the maximum relative detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting
If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles. |
VisitRequest
Request for a visit which can be done by a vehicle: it has a geo-location (or two, see below), opening and closing times represented by time windows, and a service duration time (time spent by the vehicle once it has arrived to pickup or drop off goods).
JSON representation |
---|
{ "arrivalLocation": { object ( |
Fields | |
---|---|
arrivalLocation |
The geo-location where the vehicle arrives when performing this |
arrivalWaypoint |
The waypoint where the vehicle arrives when performing this |
departureLocation |
The geo-location where the vehicle departs after completing this |
departureWaypoint |
The waypoint where the vehicle departs after completing this |
tags[] |
Specifies tags attached to the visit request. Empty or duplicate strings are not allowed. |
timeWindows[] |
Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, i.e. arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before The absence of Time windows must be disjoint, i.e. no time window must overlap with or be adjacent to another, and they must be in increasing order.
|
duration |
Duration of the visit, i.e. time spent by the vehicle between arrival and departure (to be added to the possible waiting time; see A duration in seconds with up to nine fractional digits, ending with ' |
cost |
Cost to service this visit request on a vehicle route. This can be used to pay different costs for each alternative pickup or delivery of a shipment. This cost must be in the same unit as |
loadDemands |
Load demands of this visit request. This is just like |
visitTypes[] |
Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see A type can only appear once. |
label |
Specifies a label for this |
LatLng
An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges.
JSON representation |
---|
{ "latitude": number, "longitude": number } |
Fields | |
---|---|
latitude |
The latitude in degrees. It must be in the range [-90.0, +90.0]. |
longitude |
The longitude in degrees. It must be in the range [-180.0, +180.0]. |
Waypoint
Encapsulates a waypoint. Waypoints mark arrival and departure locations of VisitRequests, and start and end locations of Vehicles.
JSON representation |
---|
{ "sideOfRoad": boolean, // Union field |
Fields | |
---|---|
sideOfRoad |
Optional. Indicates that the location of this waypoint is meant to have a preference for the vehicle to stop at a particular side of road. When you set this value, the route will pass through the location so that the vehicle can stop at the side of road that the location is biased towards from the center of the road. This option doesn't work for the 'WALKING' travel mode. |
Union field location_type . Different ways to represent a location. location_type can be only one of the following: |
|
location |
A point specified using geographic coordinates, including an optional heading. |
placeId |
The POI Place ID associated with the waypoint. |
Location
Encapsulates a location (a geographic point, and an optional heading).
JSON representation |
---|
{
"latLng": {
object ( |
Fields | |
---|---|
latLng |
The waypoint's geographic coordinates. |
heading |
The compass heading associated with the direction of the flow of traffic. This value is used to specify the side of the road to use for pickup and drop-off. Heading values can be from 0 to 360, where 0 specifies a heading of due North, 90 specifies a heading of due East, etc. |
TimeWindow
Time windows constrain the time of an event, such as the arrival time at a visit, or the start and end time of a vehicle.
Hard time window bounds, startTime
and endTime
, enforce the earliest and latest time of the event, such that startTime <= event_time <=
endTime
. The soft time window lower bound, softStartTime
, expresses a preference for the event to happen at or after softStartTime
by incurring a cost proportional to how long before softStartTime the event occurs. The soft time window upper bound, softEndTime
, expresses a preference for the event to happen at or before softEndTime
by incurring a cost proportional to how long after softEndTime
the event occurs. startTime
, endTime
, softStartTime
and softEndTime
should be within the global time limits (see ShipmentModel.global_start_time
and ShipmentModel.global_end_time
) and should respect:
0 <= `startTime` <= `endTime` and
0 <= `startTime` <= `softStartTime` and
0 <= `softEndTime` <= `endTime`.
JSON representation |
---|
{ "startTime": string, "endTime": string, "softStartTime": string, "softEndTime": string, "costPerHourBeforeSoftStartTime": number, "costPerHourAfterSoftEndTime": number } |
Fields | |
---|---|
startTime |
The hard time window start time. If unspecified it will be set to A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
endTime |
The hard time window end time. If unspecified it will be set to A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
softStartTime |
The soft start time of the time window. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
softEndTime |
The soft end time of the time window. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
costPerHourBeforeSoftStartTime |
A cost per hour added to other costs in the model if the event occurs before softStartTime, computed as:
This cost must be positive, and the field can only be set if softStartTime has been set. |
costPerHourAfterSoftEndTime |
A cost per hour added to other costs in the model if the event occurs after
This cost must be positive, and the field can only be set if |
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 |
---|
{ "displayName": string, "travelMode": enum ( |
Fields | |
---|---|
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 |
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 |
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 Routes Preferred 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. |
DistanceLimit
A limit defining a maximum distance which can be traveled. It can be either hard or soft.
If a soft limit is defined, both softMaxMeters
and costPerKilometerAboveSoftMax
must be defined and be nonnegative.
JSON representation |
---|
{ "maxMeters": string, "softMaxMeters": string, "costPerKilometerBelowSoftMax": number, "costPerKilometerAboveSoftMax": number } |
Fields | |
---|---|
maxMeters |
A hard limit constraining the distance to be at most maxMeters. The limit must be nonnegative. |
softMaxMeters |
A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit. If defined softMaxMeters must be less than maxMeters and must be nonnegative. |
costPerKilometerBelowSoftMax |
Cost per kilometer incurred, increasing up to
This cost is not supported in |
costPerKilometerAboveSoftMax |
Cost per kilometer incurred if distance is above
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 ' |
DurationDistanceMatrix
Specifies a duration and distance matrix from visit and vehicle start locations to visit and vehicle end locations.
JSON representation |
---|
{
"rows": [
{
object ( |
Fields | |
---|---|
rows[] |
Specifies the rows of the duration and distance matrix. It must have as many elements as |
vehicleStartTag |
Tag defining to which vehicles this duration and distance matrix applies. If empty, this applies to all vehicles, and there can only be a single matrix. Each vehicle start must match exactly one matrix, i.e. exactly one of their All matrices must have a different |
Row
Specifies a row of the duration and distance matrix.
JSON representation |
---|
{ "durations": [ string ], "meters": [ number ] } |
Fields | |
---|---|
durations[] |
Duration values for a given row. It must have as many elements as A duration in seconds with up to nine fractional digits, ending with ' |
meters[] |
Distance values for a given row. If no costs or constraints refer to distances in the model, this can be left empty; otherwise it must have as many elements as |
TransitionAttributes
Specifies attributes of transitions between two consecutive visits on a route. Several TransitionAttributes
may apply to the same transition: in that case, all extra costs add up and the strictest constraint or limit applies (following natural "AND" semantics).
JSON representation |
---|
{
"srcTag": string,
"excludedSrcTag": string,
"dstTag": string,
"excludedDstTag": string,
"cost": number,
"costPerKilometer": number,
"distanceLimit": {
object ( |
Fields | |
---|---|
srcTag |
Tags defining the set of (src->dst) transitions these attributes apply to. A source visit or vehicle start matches iff its |
excludedSrcTag |
See |
dstTag |
A destination visit or vehicle end matches iff its |
excludedDstTag |
See |
cost |
Specifies a cost for performing this transition. This is in the same unit as all other costs in the model and must not be negative. It is applied on top of all other existing costs. |
costPerKilometer |
Specifies a cost per kilometer applied to the distance traveled while performing this transition. It adds up to any |
distanceLimit |
Specifies a limit on the distance traveled while performing this transition. As of 2021/06, only soft limits are supported. |
delay |
Specifies a delay incurred when performing this transition. This delay always occurs after finishing the source visit and before starting the destination visit. A duration in seconds with up to nine fractional digits, ending with ' |
ShipmentTypeIncompatibility
Specifies incompatibilties between shipments depending on their shipmentType. The appearance of incompatible shipments on the same route is restricted based on the incompatibility mode.
JSON representation |
---|
{
"types": [
string
],
"incompatibilityMode": enum ( |
Fields | |
---|---|
types[] |
List of incompatible types. Two shipments having different |
incompatibilityMode |
Mode applied to the incompatibility. |
IncompatibilityMode
Modes defining how the appearance of incompatible shipments are restricted on the same route.
Enums | |
---|---|
INCOMPATIBILITY_MODE_UNSPECIFIED |
Unspecified incompatibility mode. This value should never be used. |
NOT_PERFORMED_BY_SAME_VEHICLE |
In this mode, two shipments with incompatible types can never share the same vehicle. |
NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY |
For two shipments with incompatible types with the
|
ShipmentTypeRequirement
Specifies requirements between shipments based on their shipmentType. The specifics of the requirement are defined by the requirement mode.
JSON representation |
---|
{
"requiredShipmentTypeAlternatives": [
string
],
"dependentShipmentTypes": [
string
],
"requirementMode": enum ( |
Fields | |
---|---|
requiredShipmentTypeAlternatives[] |
List of alternative shipment types required by the |
dependentShipmentTypes[] |
All shipments with a type in the NOTE: Chains of requirements such that a |
requirementMode |
Mode applied to the requirement. |
RequirementMode
Modes defining the appearance of dependent shipments on a route.
Enums | |
---|---|
REQUIREMENT_MODE_UNSPECIFIED |
Unspecified requirement mode. This value should never be used. |
PERFORMED_BY_SAME_VEHICLE |
In this mode, all "dependent" shipments must share the same vehicle as at least one of their "required" shipments. |
IN_SAME_VEHICLE_AT_PICKUP_TIME |
With the A "dependent" shipment pickup must therefore have either:
|
IN_SAME_VEHICLE_AT_DELIVERY_TIME |
Same as before, except the "dependent" shipments need to have a "required" shipment on their vehicle at the time of their delivery. |
PrecedenceRule
A precedence rule between two events (each event is the pickup or the delivery of a shipment): the "second" event has to start at least offsetDuration
after "first" has started.
Several precedences can refer to the same (or related) events, e.g., "pickup of B happens after delivery of A" and "pickup of C happens after pickup of B".
Furthermore, precedences only apply when both shipments are performed and are otherwise ignored.
JSON representation |
---|
{ "firstIsDelivery": boolean, "secondIsDelivery": boolean, "offsetDuration": string, "firstIndex": integer, "secondIndex": integer } |
Fields | |
---|---|
firstIsDelivery |
Indicates if the "first" event is a delivery. |
secondIsDelivery |
Indicates if the "second" event is a delivery. |
offsetDuration |
The offset between the "first" and "second" event. It can be negative. A duration in seconds with up to nine fractional digits, ending with ' |
firstIndex |
Shipment index of the "first" event. This field must be specified. |
secondIndex |
Shipment index of the "second" event. This field must be specified. |