REST Resource: projects.locations.workspaces.solutions

Resource: Solution

The solution contains planned routes and related metadata resulted from an optimization run.

JSON representation
{
  "name": string,
  "displayName": string,
  "optimizationResponse": {
    object (OptimizeToursResponse)
  },
  "metadata": {
    object (SolutionMetadata)
  }
}
Fields
name

string

The resource name of the solution. Format: projects/{project}/locations/{location}/workspaces/{workspace}/solutions/{solution}

displayName

string

The display name of the solution.

optimizationResponse

object (OptimizeToursResponse)

The core solution in the form of an OptimizeToursResponse, where: * routes refers to vehicles by their resource names; * requestLabel is ignored; * Deprecated fields are ignored.

metadata

object (SolutionMetadata)

The metadata for this solution.

OptimizeToursResponse

Response after solving a tour optimization problem containing the routes followed by each vehicle, the shipments which have been skipped and the overall cost of the solution.

JSON representation
{
  "routes": [
    {
      object (ShipmentRoute)
    }
  ],
  "requestLabel": string,
  "skippedShipments": [
    {
      object (SkippedShipment)
    }
  ],
  "validationErrors": [
    {
      object (OptimizeToursValidationError)
    }
  ],
  "metrics": {
    object (Metrics)
  },
  "totalCost": number
}
Fields
routes[]

object (ShipmentRoute)

Routes computed for each vehicle; the i-th route corresponds to the i-th vehicle in the model.

requestLabel

string

Copy of the OptimizeToursRequest.label, if a label was specified in the request.

skippedShipments[]

object (SkippedShipment)

The list of all shipments skipped.

validationErrors[]

object (OptimizeToursValidationError)

List of all the validation errors that we were able to detect independently. See the "MULTIPLE ERRORS" explanation for the OptimizeToursValidationError message.

metrics

object (Metrics)

Duration, distance and usage metrics for this solution.

totalCost
(deprecated)

number

Deprecated: Use Metrics.total_cost instead. Total cost of the solution. This takes into account all costs: costs per per hour and travel hour, fixed vehicle costs, unperformed shipment penalty costs, global duration cost, etc.

ShipmentRoute

A vehicle's route can be decomposed, along the time axis, like this (we assume there are n visits):

  |            |            |          |       |  T[2], |        |      |
  | Transition |  Visit #0  |          |       |  V[2], |        |      |
  |     #0     |    aka     |   T[1]   |  V[1] |  ...   | V[n-1] | T[n] |
  |  aka T[0]  |    V[0]    |          |       | V[n-2],|        |      |
  |            |            |          |       | T[n-1] |        |      |
  ^            ^            ^          ^       ^        ^        ^      ^
vehicle    V[0].start   V[0].end     V[1].   V[1].    V[n].    V[n]. vehicle
 start     (arrival)   (departure)   start   end      start    end     end

Note that we make a difference between:

  • "punctual events", such as the vehicle start and end and each visit's start and end (aka arrival and departure). They happen at a given second.
  • "time intervals", such as the visits themselves, and the transition between visits. Though time intervals can sometimes have zero duration, i.e. start and end at the same second, they often have a positive duration.

Invariants:

  • If there are n visits, there are n+1 transitions.
  • A visit is always surrounded by a transition before it (same index) and a transition after it (index + 1).
  • The vehicle start is always followed by transition #0.
  • The vehicle end is always preceded by transition #n.

Zooming in, here is what happens during a Transition and a Visit:

---+-------------------------------------+-----------------------------+-->
   |           TRANSITION[i]             |           VISIT[i]          |
   |                                     |                             |
   |  * TRAVEL: the vehicle moves from   |      PERFORM the visit:     |
   |    VISIT[i-1].departure_location to |                             |
   |    VISIT[i].arrival_location, which |  * Spend some time:         |
   |    takes a given travel duration    |    the "visit duration".    |
   |    and distance                     |                             |
   |                                     |  * Load or unload           |
   |  * BREAKS: the driver may have      |    some quantities from the |
   |    breaks (e.g. lunch break).       |    vehicle: the "demand".   |
   |                                     |                             |
   |  * WAIT: the driver/vehicle does    |                             |
   |    nothing. This can happen for     |                             |
   |    many reasons, for example when   |                             |
   |    the vehicle reaches the next     |                             |
   |    event's destination before the   |                             |
   |    start of its time window         |                             |
   |                                     |                             |
   |  * DELAY: *right before* the next   |                             |
   |    arrival. E.g. the vehicle and/or |                             |
   |    driver spends time unloading.    |                             |
   |                                     |                             |
---+-------------------------------------+-----------------------------+-->
   ^                                     ^                             ^
V[i-1].end                           V[i].start                    V[i].end

Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged during a transition.

  • They don't overlap.
  • The DELAY is unique and must be a contiguous period of time right before the next visit (or vehicle end). Thus, it suffice to know the delay duration to know its start and end time.
  • The BREAKS are contiguous, non-overlapping periods of time. The response specifies the start time and duration of each break.
  • TRAVEL and WAIT are "preemptable": they can be interrupted several times during this transition. Clients can assume that travel happens "as soon as possible" and that "wait" fills the remaining time.

A (complex) example:

                               TRANSITION[i]
--++-----+-----------------------------------------------------------++-->
  ||     |       |           |       |           |         |         ||
  ||  T  |   B   |     T     |       |     B     |         |    D    ||
  ||  r  |   r   |     r     |   W   |     r     |    W    |    e    ||
  ||  a  |   e   |     a     |   a   |     e     |    a    |    l    ||
  ||  v  |   a   |     v     |   i   |     a     |    i    |    a    ||
  ||  e  |   k   |     e     |   t   |     k     |    t    |    y    ||
  ||  l  |       |     l     |       |           |         |         ||
  ||     |       |           |       |           |         |         ||
--++-----------------------------------------------------------------++-->
JSON representation
{
  "vehicleIndex": integer,
  "vehicleLabel": string,
  "vehicleName": string,
  "vehicleStartTime": string,
  "vehicleEndTime": string,
  "visits": [
    {
      object (Visit)
    }
  ],
  "transitions": [
    {
      object (Transition)
    }
  ],
  "hasTrafficInfeasibilities": boolean,
  "routePolyline": {
    object (EncodedPolyline)
  },
  "breaks": [
    {
      object (Break)
    }
  ],
  "metrics": {
    object (AggregatedMetrics)
  },
  "routeCosts": {
    string: number,
    ...
  },
  "routeTotalCost": number,
  "endLoads": [
    {
      object (CapacityQuantity)
    }
  ],
  "travelSteps": [
    {
      object (TravelStep)
    }
  ],
  "vehicleDetour": string,
  "delayBeforeVehicleEnd": {
    object (Delay)
  }
}
Fields
vehicleIndex

integer

Vehicle performing the route, identified by its index in the source ShipmentModel.

vehicleLabel

string

Label of the vehicle performing this route, equal to ShipmentModel.vehicles(vehicleIndex).label, if specified.

vehicleName

string

Name of the vehicle performing this route. It is used in the stateful service only.

vehicleStartTime

string (Timestamp format)

Time at which the vehicle starts its route.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

vehicleEndTime

string (Timestamp format)

Time at which the vehicle finishes its route.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

visits[]

object (Visit)

Ordered sequence of visits representing a route. visits[i] is the i-th visit in the route. If this field is empty, the vehicle is considered as unused.

transitions[]

object (Transition)

Ordered list of transitions for the route.

hasTrafficInfeasibilities

boolean

When OptimizeToursRequest.consider_road_traffic, is set to true, this field indicates that inconsistencies in route timings are predicted using traffic-based travel duration estimates. There may be insufficient time to complete traffic-adjusted travel, delays, and breaks between visits, before the first visit, or after the last visit, while still satisfying the visit and vehicle time windows. For example,

  startTime(previous_visit) + duration(previous_visit) +
  travelDuration(previous_visit, next_visit) > startTime(next_visit)

Arrival at next_visit will likely happen later than its current time window due the increased estimate of travel time travelDuration(previous_visit, next_visit) due to traffic. Also, a break may be forced to overlap with a visit due to an increase in travel time estimates and visit or break time window restrictions.

routePolyline

object (EncodedPolyline)

The encoded polyline representation of the route. This field is only populated if OptimizeToursRequest.populate_polylines is set to true.

breaks[]

object (Break)

Breaks scheduled for the vehicle performing this route. The breaks sequence represents time intervals, each starting at the corresponding startTime and lasting duration seconds.

metrics

object (AggregatedMetrics)

Duration, distance and load metrics for this route. The fields of AggregatedMetrics are summed over all ShipmentRoute.transitions or ShipmentRoute.visits, depending on the context.

routeCosts

map (key: string, value: number)

Cost of the route, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole route. In other words, costs["model.shipments.pickups.cost"] is the sum of all pickup costs over the route. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.

routeTotalCost

number

Total cost of the route. The sum of all costs in the cost map.

endLoads[]
(deprecated)

object (CapacityQuantity)

Deprecated: Use Transition.vehicle_loads instead. Vehicle loads upon arrival at its end location, for each type specified in Vehicle.capacities, startLoadIntervals, endLoadIntervals or demands. Exception: we omit loads for quantity types unconstrained by intervals and that don't have any non-zero demand on the route.

travelSteps[]
(deprecated)

object (TravelStep)

Deprecated: Use ShipmentRoute.transitions instead. Ordered list of travel steps for the route.

vehicleDetour
(deprecated)

string (Duration format)

Deprecated: No longer used. This field will only be populated at the ShipmentRoute.Visit level.

This field is the extra detour time due to the shipments visited on the route.

It is equal to vehicleEndTime - vehicleStartTime - travel duration from the vehicle's startLocation to its endLocation.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

delayBeforeVehicleEnd
(deprecated)

object (Delay)

Deprecated: Delay occurring before the vehicle end. See TransitionAttributes.delay.

Visit

A visit performed during a route. This visit corresponds to a pickup or a delivery of a Shipment.

JSON representation
{
  "shipmentIndex": integer,
  "shipmentName": string,
  "isPickup": boolean,
  "visitRequestIndex": integer,
  "startTime": string,
  "loadDemands": {
    string: {
      object (Load)
    },
    ...
  },
  "detour": string,
  "shipmentLabel": string,
  "visitLabel": string,
  "arrivalLoads": [
    {
      object (CapacityQuantity)
    }
  ],
  "delayBeforeStart": {
    object (Delay)
  },
  "demands": [
    {
      object (CapacityQuantity)
    }
  ]
}
Fields
shipmentIndex

integer

Index of the shipments field in the source ShipmentModel.

shipmentName

string

Name of the shipment. It is used in the stateful service only.

isPickup

boolean

If true the visit corresponds to a pickup of a Shipment. Otherwise, it corresponds to a delivery.

visitRequestIndex

integer

Index of VisitRequest in either the pickup or delivery field of the Shipment (see isPickup).

startTime

string (Timestamp format)

Time at which the visit starts. Note that the vehicle may arrive earlier than this at the visit location. Times are consistent with the ShipmentModel.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

loadDemands

map (key: string, value: object (Load))

Total visit load demand as the sum of the shipment and the visit request loadDemands. The values are negative if the visit is a delivery. Demands are reported for the same types as the Transition.loads (see this field).

detour

string (Duration format)

Extra detour time due to the shipments visited on the route before the visit and to the potential waiting time induced by time windows. If the visit is a delivery, the detour is computed from the corresponding pickup visit and is equal to:

startTime(delivery) - startTime(pickup)
- (duration(pickup) + travel duration from the pickup location
to the delivery location).

Otherwise, it is computed from the vehicle startLocation and is equal to:

startTime - vehicleStartTime - travel duration from
the vehicle's `startLocation` to the visit.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

shipmentLabel

string

Copy of the corresponding Shipment.label, if specified in the Shipment.

visitLabel

string

Copy of the corresponding VisitRequest.label, if specified in the VisitRequest.

arrivalLoads[]
(deprecated)

object (CapacityQuantity)

Deprecated: Use Transition.vehicle_loads instead. Vehicle loads upon arrival at the visit location, for each type specified in Vehicle.capacities, startLoadIntervals, endLoadIntervals or demands.

Exception: we omit loads for quantity types unconstrained by intervals and that don't have any non-zero demand on the route.

delayBeforeStart
(deprecated)

object (Delay)

Deprecated: Use ShipmentRoute.Transition.delay_duration instead. Delay occurring before the visit starts.

demands[]
(deprecated)

object (CapacityQuantity)

Deprecated: Use Visit.load_demands instead.

Delay

Deprecated: Use ShipmentRoute.Transition.delay_duration instead. Time interval spent on the route resulting from a TransitionAttributes.delay.

JSON representation
{
  "startTime": string,
  "duration": string
}
Fields
startTime

string (Timestamp format)

Start of the delay.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

duration

string (Duration format)

Duration of the delay.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Transition

Transition between two events on the route. See the description of ShipmentRoute.

If the vehicle does not have a startLocation and/or endLocation, the corresponding travel metrics are 0.

JSON representation
{
  "travelDuration": string,
  "travelDistanceMeters": number,
  "trafficInfoUnavailable": boolean,
  "delayDuration": string,
  "breakDuration": string,
  "waitDuration": string,
  "totalDuration": string,
  "startTime": string,
  "routePolyline": {
    object (EncodedPolyline)
  },
  "vehicleLoads": {
    string: {
      object (VehicleLoad)
    },
    ...
  },
  "loads": [
    {
      object (CapacityQuantity)
    }
  ]
}
Fields
travelDuration

string (Duration format)

Travel duration during this transition.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

travelDistanceMeters

number

Distance traveled during the transition.

trafficInfoUnavailable

boolean

When traffic is requested via OptimizeToursRequest.consider_road_traffic, and the traffic info couldn't be retrieved for a Transition, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).

delayDuration

string (Duration format)

Sum of the delay durations applied to this transition. If any, the delay starts exactly delayDuration seconds before the next event (visit or vehicle end). See TransitionAttributes.delay.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

breakDuration

string (Duration format)

Sum of the duration of the breaks occurring during this transition, if any. Details about each break's start time and duration are stored in ShipmentRoute.breaks.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

waitDuration

string (Duration format)

Time spent waiting during this transition. Wait duration corresponds to idle time and does not include break time. Also note that this wait time may be split into several non-contiguous intervals.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

totalDuration

string (Duration format)

Total duration of the transition, provided for convenience. It is equal to:

  • next visit startTime (or vehicleEndTime if this is the last transition) - this transition's startTime;
  • if ShipmentRoute.has_traffic_infeasibilities is false, the following additionally holds: `totalDuration = travelDuration + delayDuration
  • breakDuration + waitDuration`.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

startTime

string (Timestamp format)

Start time of this transition.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

routePolyline

object (EncodedPolyline)

The encoded polyline representation of the route followed during the transition. This field is only populated if populateTransitionPolylines is set to true.

vehicleLoads

map (key: string, value: object (VehicleLoad))

Vehicle loads during this transition, for each type that either appears in this vehicle's Vehicle.load_limits, or that have non-zero Shipment.load_demands on some shipment performed on this route.

The loads during the first transition are the starting loads of the vehicle route. Then, after each visit, the visit's loadDemands are either added or subtracted to get the next transition's loads, depending on whether the visit was a pickup or a delivery.

loads[]
(deprecated)

object (CapacityQuantity)

Deprecated: Use Transition.vehicle_loads instead.

EncodedPolyline

The encoded representation of a polyline. More information on polyline encoding can be found here: https://developers.google.com/maps/documentation/utilities/polylinealgorithm https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.

JSON representation
{
  "points": string
}
Fields
points

string

String representing encoded points of the polyline.

VehicleLoad

Reports the actual load of the vehicle at some point along the route, for a given type (see Transition.vehicle_loads).

JSON representation
{
  "amount": string
}
Fields
amount

string (int64 format)

The amount of load on the vehicle, for the given type. The unit of load is usually indicated by the type. See Transition.vehicle_loads.

Break

Data representing the execution of a break.

JSON representation
{
  "startTime": string,
  "duration": string
}
Fields
startTime

string (Timestamp format)

Start time of a break.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

duration

string (Duration format)

Duration of a break.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

AggregatedMetrics

Aggregated metrics for ShipmentRoute (resp. for OptimizeToursResponse over all Transition and/or Visit (resp. over all ShipmentRoute) elements.

JSON representation
{
  "performedShipmentCount": integer,
  "travelDuration": string,
  "waitDuration": string,
  "delayDuration": string,
  "breakDuration": string,
  "visitDuration": string,
  "totalDuration": string,
  "travelDistanceMeters": number,
  "maxLoads": {
    string: {
      object (VehicleLoad)
    },
    ...
  },
  "costs": {
    string: number,
    ...
  },
  "totalCost": number
}
Fields
performedShipmentCount

integer

Number of shipments performed. Note that a pickup and delivery pair only counts once.

travelDuration

string (Duration format)

Total travel duration for a route or a solution.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

waitDuration

string (Duration format)

Total wait duration for a route or a solution.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

delayDuration

string (Duration format)

Total delay duration for a route or a solution.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

breakDuration

string (Duration format)

Total break duration for a route or a solution.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

visitDuration

string (Duration format)

Total visit duration for a route or a solution.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

totalDuration

string (Duration format)

The total duration should be equal to the sum of all durations above. For routes, it also corresponds to: ShipmentRoute.vehicle_end_time - ShipmentRoute.vehicle_start_time

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

travelDistanceMeters

number

Total travel distance for a route or a solution.

maxLoads

map (key: string, value: object (VehicleLoad))

Maximum load achieved over the entire route (resp. solution), for each of the quantities on this route (resp. solution), computed as the maximum over all Transition.vehicle_loads (resp. ShipmentRoute.metrics.max_loads.

costs
(deprecated)

map (key: string, value: number)

Deprecated: Use ShipmentRoute.route_costs and OptimizeToursResponse.Metrics.costs instead.

totalCost
(deprecated)

number

Deprecated: Use ShipmentRoute.route_total_cost and OptimizeToursResponse.Metrics.total_cost instead.

TravelStep

Deprecated: Use ShipmentRoute.Transition instead. Travel between each visit along the route: from the vehicle's startLocation to the first visit's arrivalLocation, then from the first visit's departureLocation to the second visit's arrivalLocation, and so on until the vehicle's endLocation. This accounts only for the actual travel between visits, not counting the waiting time, the time spent performing a visit, nor the distance covered during a visit.

Invariant: travel_steps_size() == visits_size() + 1.

If the vehicle does not have a start_ and/or endLocation, the corresponding travel metrics are 0 and/or empty.

JSON representation
{
  "duration": string,
  "distanceMeters": number,
  "trafficInfoUnavailable": boolean,
  "routePolyline": {
    object (EncodedPolyline)
  }
}
Fields
duration

string (Duration format)

Duration of the travel step.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

distanceMeters

number

Distance traveled during the step.

trafficInfoUnavailable

boolean

When traffic is requested via OptimizeToursRequest.consider_road_traffic, and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).

routePolyline

object (EncodedPolyline)

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

SkippedShipment

Specifies details of unperformed shipments in a solution. For trivial cases and/or if we are able to identify the cause for skipping, we report the reason here.

JSON representation
{
  "index": integer,
  "label": string,
  "shipmentName": string,
  "reasons": [
    {
      object (Reason)
    }
  ]
}
Fields
index

integer

The index corresponds to the index of the shipment in the source ShipmentModel.

label

string

Copy of the corresponding Shipment.label, if specified in the Shipment.

shipmentName

string

Name of the shipment. It is used in the stateful service only.

reasons[]

object (Reason)

A list of reasons that explain why the shipment was skipped. See comment above Reason.

Reason

If we can explain why the shipment was skipped, reasons will be listed here. If the reason is not the same for all vehicles, reason will have more than 1 element. A skipped shipment cannot have duplicate reasons, i.e. where all fields are the same except for exampleVehicleIndex. Example:

reasons {
  code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
  exampleVehicleIndex: 1
  exampleExceededCapacityType: "Apples"
}
reasons {
  code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
  exampleVehicleIndex: 3
  exampleExceededCapacityType: "Pears"
}
reasons {
  code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
  exampleVehicleIndex: 1
}

The skipped shipment is incompatible with all vehicles. The reasons may be different for all vehicles but at least one vehicle's "Apples" capacity would be exceeded (including vehicle 1), at least one vehicle's "Pears" capacity would be exceeded (including vehicle 3) and at least one vehicle's distance limit would be exceeded (including vehicle 1).

JSON representation
{
  "code": enum (Code),
  "exampleVehicleName": string,
  "exampleExceededCapacityType": string,
  "exampleVehicleIndex": integer
}
Fields
code

enum (Code)

Refer to the comments of Code.

exampleVehicleName

string

If the reason is related to a shipment-vehicle incompatibility, this field provides the resource name of one relevant vehicle. This field is used in the stateful service only.

exampleExceededCapacityType

string

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY, documents one capacity type that is exceeded.

exampleVehicleIndex

integer

If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle.

Code

Code identifying the reason type. The order here is meaningless. In particular, it gives no indication of whether a given reason will appear before another in the solution, if both apply.

Enums
CODE_UNSPECIFIED This should never be used. If we are unable to understand why a shipment was skipped, we simply return an empty set of reasons.
NO_VEHICLE There is no vehicle in the model making all shipments infeasible.
DEMAND_EXCEEDS_VEHICLE_CAPACITY The demand of the shipment exceeds a vehicle's capacity for some capacity types, one of which is exampleExceededCapacityType.
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT

The minimum distance necessary to perform this shipment, i.e. from the vehicle's startLocation to the shipment's pickup and/or delivery locations and to the vehicle's end location exceeds the vehicle's routeDistanceLimit.

Note that for this computation we use the geodesic distances.

CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT

The minimum time necessary to perform this shipment, including travel time, wait time and service time exceeds the vehicle's routeDurationLimit.

Note: travel time is computed in the best-case scenario, namely as geodesic distance x 36 m/s (roughly 130 km/hour).

CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT Same as above but we only compare minimum travel time and the vehicle's travelDurationLimit.
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS The vehicle cannot perform this shipment in the best-case scenario (see CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT for time computation) if it starts at its earliest start time: the total time would make the vehicle end after its latest end time.
VEHICLE_NOT_ALLOWED The allowedVehicleIndices field of the shipment is not empty and this vehicle does not belong to it.

OptimizeToursValidationError

Describes an error encountered when validating an OptimizeToursRequest.

JSON representation
{
  "code": integer,
  "displayName": string,
  "fields": [
    {
      object (FieldReference)
    }
  ],
  "errorMessage": string,
  "offendingValues": string
}
Fields
code

integer

A validation error is defined by the pair (code, displayName) which are always present.

Other fields (below) provide more context about the error.

MULTIPLE ERRORS: When there are multiple errors, the validation process tries to output several of them. Much like a compiler, this is an imperfect process. Some validation errors will be "fatal", meaning that they stop the entire validation process. This is the case for displayName="UNSPECIFIED" errors, among others. Some may cause the validation process to skip other errors.

STABILITY: code and displayName should be very stable. But new codes and display names may appear over time, which may cause a given (invalid) request to yield a different (code, displayName) pair because the new error hid the old one (see "MULTIPLE ERRORS").

REFERENCE: A list of all (code, name) pairs:

  • UNSPECIFIED = 0;
  • VALIDATION_TIMEOUT_ERROR = 10; Validation couldn't be completed within the deadline.
  • REQUEST_OPTIONS_ERROR = 12;

    • REQUEST_OPTIONS_INVALID_SOLVING_MODE = 1201;
    • REQUEST_OPTIONS_INVALID_MAX_VALIDATION_ERRORS = 1203;
    • REQUEST_OPTIONS_INVALID_GEODESIC_METERS_PER_SECOND = 1204;
    • REQUEST_OPTIONS_GEODESIC_METERS_PER_SECOND_TOO_SMALL = 1205;
    • REQUEST_OPTIONS_MISSING_GEODESIC_METERS_PER_SECOND = 1206;
    • REQUEST_OPTIONS_POPULATE_PATHFINDER_TRIPS_AND_GEODESIC_DISTANCE = 1207;
    • REQUEST_OPTIONS_COST_MODEL_OPTIONS_AND_GEODESIC_DISTANCE = 1208;
    • REQUEST_OPTIONS_TRAVEL_MODE_INCOMPATIBLE_WITH_TRAFFIC = 1211;
    • REQUEST_OPTIONS_MULTIPLE_TRAFFIC_FLAVORS = 1212;
    • REQUEST_OPTIONS_INVALID_TRAFFIC_FLAVOR = 1213;
    • REQUEST_OPTIONS_TRAFFIC_ENABLED_WITHOUT_GLOBAL_START_TIME = 1214;
    • REQUEST_OPTIONS_TRAFFIC_ENABLED_WITH_PRECEDENCES = 1215;
    • REQUEST_OPTIONS_TRAFFIC_PREFILL_MODE_INVALID = 1216;
    • REQUEST_OPTIONS_TRAFFIC_PREFILL_ENABLED_WITHOUT_TRAFFIC = 1217;
  • INJECTED_SOLUTION_ERROR = 20;
    • INJECTED_SOLUTION_MISSING_LABEL = 2000;
    • INJECTED_SOLUTION_DUPLICATE_LABEL = 2001;
    • INJECTED_SOLUTION_AMBIGUOUS_INDEX = 2002;
    • INJECTED_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES = 2003;
    • INJECTED_SOLUTION_TRANSITION_INCONSISTENT_WITH_ACTUAL_TRAVEL = 2004;
    • INJECTED_SOLUTION_CONCURRENT_SOLUTION_TYPES = 2005;
    • INJECTED_SOLUTION_MORE_THAN_ONE_PER_TYPE = 2006;
    • INJECTED_SOLUTION_REFRESH_WITHOUT_POPULATE = 2008;
    • INJECTED_SOLUTION_CONSTRAINED_ROUTE_PORTION_INFEASIBLE = 2010;
  • SHIPMENT_MODEL_ERROR = 22;
    • SHIPMENT_MODEL_TOO_LARGE = 2200;
    • SHIPMENT_MODEL_TOO_MANY_CAPACITY_TYPES = 2201;
    • SHIPMENT_MODEL_GLOBAL_START_TIME_NEGATIVE_OR_NAN = 2202;
    • SHIPMENT_MODEL_GLOBAL_END_TIME_TOO_LARGE_OR_NAN = 2203;
    • SHIPMENT_MODEL_GLOBAL_START_TIME_AFTER_GLOBAL_END_TIME = 2204;
    • SHIPMENT_MODEL_GLOBAL_DURATION_TOO_LONG = 2205;
    • SHIPMENT_MODEL_MAX_ACTIVE_VEHICLES_NOT_POSITIVE = 2206;
    • SHIPMENT_MODEL_DURATION_MATRIX_TOO_LARGE = 2207;
  • INDEX_ERROR = 24;
  • TAG_ERROR = 26;
  • TIME_WINDOW_ERROR = 28;
    • TIME_WINDOW_INVALID_START_TIME = 2800;
    • TIME_WINDOW_INVALID_END_TIME = 2801;
    • TIME_WINDOW_INVALID_SOFT_START_TIME = 2802;
    • TIME_WINDOW_INVALID_SOFT_END_TIME = 2803;
    • TIME_WINDOW_OUTSIDE_GLOBAL_TIME_WINDOW = 2804;
    • TIME_WINDOW_START_TIME_AFTER_END_TIME = 2805;
    • TIME_WINDOW_INVALID_COST_PER_HOUR_BEFORE_SOFT_START_TIME = 2806;
    • TIME_WINDOW_INVALID_COST_PER_HOUR_AFTER_SOFT_END_TIME = 2807;
    • TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_WITHOUT_SOFT_START_TIME = 2808;
    • TIME_WINDOW_COST_AFTER_SOFT_END_TIME_WITHOUT_SOFT_END_TIME = 2809;
    • TIME_WINDOW_SOFT_START_TIME_WITHOUT_COST_BEFORE_SOFT_START_TIME = 2810;
    • TIME_WINDOW_SOFT_END_TIME_WITHOUT_COST_AFTER_SOFT_END_TIME = 2811;
    • TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS = 2812;
    • TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
    • TIME_WINDOW_SOFT_START_TIME_AFTER_END_TIME = 2814;
    • TIME_WINDOW_START_TIME_AFTER_SOFT_END_TIME = 2815;
    • TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
    • TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS = 2817;
    • TIME_WINDOW_COST_AFTER_SOFT_END_TIME_SET_AND_MULTIPLE_WINDOWS = 2818;
    • TRANSITION_ATTRIBUTES_ERROR = 30;
    • TRANSITION_ATTRIBUTES_INVALID_COST = 3000;
    • TRANSITION_ATTRIBUTES_INVALID_COST_PER_KILOMETER = 3001;
    • TRANSITION_ATTRIBUTES_DUPLICATE_TAG_PAIR = 3002;
    • TRANSITION_ATTRIBUTES_DISTANCE_LIMIT_MAX_METERS_UNSUPPORTED = 3003;
    • TRANSITION_ATTRIBUTES_UNSPECIFIED_SOURCE_TAGS = 3004;
    • TRANSITION_ATTRIBUTES_CONFLICTING_SOURCE_TAGS_FIELDS = 3005;
    • TRANSITION_ATTRIBUTES_UNSPECIFIED_DESTINATION_TAGS = 3006;
    • TRANSITION_ATTRIBUTES_CONFLICTING_DESTINATION_TAGS_FIELDS = 3007;
    • TRANSITION_ATTRIBUTES_DELAY_DURATION_NEGATIVE_OR_NAN = 3008;
    • TRANSITION_ATTRIBUTES_DELAY_DURATION_EXCEEDS_GLOBAL_DURATION = 3009;
  • AMOUNT_ERROR = 31;
    • AMOUNT_NEGATIVE_VALUE = 3100;
  • LOAD_LIMIT_ERROR = 33;
    • LOAD_LIMIT_INVALID_COST_ABOVE_SOFT_MAX = 3303;
    • LOAD_LIMIT_SOFT_MAX_WITHOUT_COST_ABOVE_SOFT_MAX = 3304;
    • LOAD_LIMIT_COST_ABOVE_SOFT_MAX_WITHOUT_SOFT_MAX = 3305;
    • LOAD_LIMIT_NEGATIVE_SOFT_MAX = 3306;
    • LOAD_LIMIT_MIXED_DEMAND_TYPE = 3307;
    • LOAD_LIMIT_MAX_LOAD_NEGATIVE_VALUE = 3308;
    • LOAD_LIMIT_SOFT_MAX_ABOVE_MAX = 3309;
  • INTERVAL_ERROR = 34;
    • INTERVAL_MIN_EXCEEDS_MAX = 3401;
    • INTERVAL_NEGATIVE_MIN = 3402;
    • INTERVAL_NEGATIVE_MAX = 3403;
    • INTERVAL_MIN_EXCEEDS_CAPACITY = 3404;
    • INTERVAL_MAX_EXCEEDS_CAPACITY = 3405;
  • DISTANCE_LIMIT_ERROR = 36;
    • DISTANCE_LIMIT_INVALID_COST_AFTER_SOFT_MAX = 3601;
    • DISTANCE_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3602;
    • DISTANCE_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3603;
    • DISTANCE_LIMIT_NEGATIVE_MAX = 3604;
    • DISTANCE_LIMIT_NEGATIVE_SOFT_MAX = 3605;
    • DISTANCE_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3606;
  • DURATION_LIMIT_ERROR = 38;
    • DURATION_LIMIT_MAX_DURATION_NEGATIVE_OR_NAN = 3800;
    • DURATION_LIMIT_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3801;
    • DURATION_LIMIT_INVALID_COST_PER_HOUR_AFTER_SOFT_MAX = 3802;
    • DURATION_LIMIT_SOFT_MAX_WITHOUT_COST_AFTER_SOFT_MAX = 3803;
    • DURATION_LIMIT_COST_AFTER_SOFT_MAX_WITHOUT_SOFT_MAX = 3804;
    • DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_NEGATIVE_OR_NAN = 3805;
    • DURATION_LIMIT_INVALID_COST_AFTER_QUADRATIC_SOFT_MAX = 3806;
    • DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_COST_PER_SQUARE_HOUR = 3807;
    • DURATION_LIMIT_COST_PER_SQUARE_HOUR_WITHOUT_QUADRATIC_SOFT_MAX = 3808;
    • DURATION_LIMIT_QUADRATIC_SOFT_MAX_WITHOUT_MAX = 3809;
    • DURATION_LIMIT_SOFT_MAX_LARGER_THAN_MAX = 3810;
    • DURATION_LIMIT_QUADRATIC_SOFT_MAX_LARGER_THAN_MAX = 3811;
    • DURATION_LIMIT_DIFF_BETWEEN_MAX_AND_QUADRATIC_SOFT_MAX_TOO_LARGE = 3812;
    • DURATION_LIMIT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3813;
    • DURATION_LIMIT_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3814;
    • DURATION_LIMIT_QUADRATIC_SOFT_MAX_DURATION_EXCEEDS_GLOBAL_DURATION = 3815;
  • SHIPMENT_ERROR = 40;
    • SHIPMENT_PD_LIMIT_WITHOUT_PICKUP_AND_DELIVERY = 4014;
    • SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_NEGATIVE_OR_NAN = 4000;
    • SHIPMENT_PD_ABSOLUTE_DETOUR_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4001;
    • SHIPMENT_PD_RELATIVE_DETOUR_LIMIT_INVALID = 4015;
    • SHIPMENT_PD_DETOUR_LIMIT_AND_EXTRA_VISIT_DURATION = 4016;
    • SHIPMENT_PD_TIME_LIMIT_DURATION_NEGATIVE_OR_NAN = 4002;
    • SHIPMENT_PD_TIME_LIMIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4003;
    • SHIPMENT_EMPTY_SHIPMENT_TYPE = 4004;
    • SHIPMENT_NO_PICKUP_NO_DELIVERY = 4005;
    • SHIPMENT_INVALID_PENALTY_COST = 4006;
    • SHIPMENT_ALLOWED_VEHICLE_INDEX_OUT_OF_BOUNDS = 4007;
    • SHIPMENT_DUPLICATE_ALLOWED_VEHICLE_INDEX = 4008;
    • SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITHOUT_INDEX = 4009;
    • SHIPMENT_INCONSISTENT_COST_FOR_VEHICLE_SIZE_WITH_INDEX = 4010;
    • SHIPMENT_INVALID_COST_FOR_VEHICLE = 4011;
    • SHIPMENT_COST_FOR_VEHICLE_INDEX_OUT_OF_BOUNDS = 4012;
    • SHIPMENT_DUPLICATE_COST_FOR_VEHICLE_INDEX = 4013;
  • VEHICLE_ERROR = 42;
    • VEHICLE_EMPTY_REQUIRED_OPERATOR_TYPE = 4200;
    • VEHICLE_DUPLICATE_REQUIRED_OPERATOR_TYPE = 4201;
    • VEHICLE_NO_OPERATOR_WITH_REQUIRED_OPERATOR_TYPE = 4202;
    • VEHICLE_EMPTY_START_TAG = 4203;
    • VEHICLE_DUPLICATE_START_TAG = 4204;
    • VEHICLE_EMPTY_END_TAG = 4205;
    • VEHICLE_DUPLICATE_END_TAG = 4206;
    • VEHICLE_EXTRA_VISIT_DURATION_NEGATIVE_OR_NAN = 4207;
    • VEHICLE_EXTRA_VISIT_DURATION_EXCEEDS_GLOBAL_DURATION = 4208;
    • VEHICLE_EXTRA_VISIT_DURATION_EMPTY_KEY = 4209;
    • VEHICLE_FIRST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4210;
    • VEHICLE_FIRST_SHIPMENT_IGNORED = 4211;
    • VEHICLE_FIRST_SHIPMENT_NOT_BOUND = 4212;
    • VEHICLE_LAST_SHIPMENT_INDEX_OUT_OF_BOUNDS = 4213;
    • VEHICLE_LAST_SHIPMENT_IGNORED = 4214;
    • VEHICLE_LAST_SHIPMENT_NOT_BOUND = 4215;
    • VEHICLE_IGNORED_WITH_USED_IF_ROUTE_IS_EMPTY = 4216;
    • VEHICLE_INVALID_COST_PER_KILOMETER = 4217;
    • VEHICLE_INVALID_COST_PER_HOUR = 4218;
    • VEHICLE_INVALID_COST_PER_TRAVELED_HOUR = 4219;
    • VEHICLE_INVALID_FIXED_COST = 4220;
    • VEHICLE_INVALID_TRAVEL_DURATION_MULTIPLE = 4221;
    • VEHICLE_TRAVEL_DURATION_MULTIPLE_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4223;
    • VEHICLE_MATRIX_INDEX_WITH_SHIPMENT_PD_DETOUR_LIMITS = 4224;
    • VEHICLE_MINIMUM_DURATION_LONGER_THAN_DURATION_LIMIT = 4222;
  • VISIT_REQUEST_ERROR = 44;
    • VISIT_REQUEST_EMPTY_TAG = 4400;
    • VISIT_REQUEST_DUPLICATE_TAG = 4401;
    • VISIT_REQUEST_DURATION_NEGATIVE_OR_NAN = 4404;
    • VISIT_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4405;
  • PRECEDENCE_ERROR = 46;
    • PRECEDENCE_RULE_MISSING_FIRST_INDEX = 4600;
    • PRECEDENCE_RULE_MISSING_SECOND_INDEX = 4601;
    • PRECEDENCE_RULE_FIRST_INDEX_OUT_OF_BOUNDS = 4602;
    • PRECEDENCE_RULE_SECOND_INDEX_OUT_OF_BOUNDS = 4603;
    • PRECEDENCE_RULE_DUPLICATE_INDEX = 4604;
    • PRECEDENCE_RULE_INEXISTENT_FIRST_VISIT_REQUEST = 4605;
    • PRECEDENCE_RULE_INEXISTENT_SECOND_VISIT_REQUEST = 4606;
  • BREAK_ERROR = 48;
    • BREAK_RULE_EMPTY = 4800;
    • BREAK_REQUEST_UNSPECIFIED_DURATION = 4801;
    • BREAK_REQUEST_UNSPECIFIED_EARLIEST_START_TIME = 4802;
    • BREAK_REQUEST_UNSPECIFIED_LATEST_START_TIME = 4803;
    • BREAK_REQUEST_DURATION_NEGATIVE_OR_NAN = 4804; = 4804;
    • BREAK_REQUEST_LATEST_START_TIME_BEFORE_EARLIEST_START_TIME = 4805;
    • BREAK_REQUEST_EARLIEST_START_TIME_BEFORE_GLOBAL_START_TIME = 4806;
    • BREAK_REQUEST_LATEST_END_TIME_AFTER_GLOBAL_END_TIME = 4807;
    • BREAK_REQUEST_NON_SCHEDULABLE = 4808;
    • BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_NEGATIVE_OR_NAN = 4809;
    • BREAK_FREQUENCY_MIN_BREAK_DURATION_NEGATIVE_OR_NAN = 4810;
    • BREAK_FREQUENCY_MIN_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4811;
    • BREAK_FREQUENCY_MAX_INTER_BREAK_DURATION_EXCEEDS_GLOBAL_DURATION = 4812;
    • BREAK_REQUEST_DURATION_EXCEEDS_GLOBAL_DURATION = 4813;
    • BREAK_FREQUENCY_MISSING_MAX_INTER_BREAK_DURATION = 4814;
    • BREAK_FREQUENCY_MISSING_MIN_BREAK_DURATION = 4815;
  • SHIPMENT_TYPE_INCOMPATIBILITY_ERROR = 50;
    • SHIPMENT_TYPE_INCOMPATIBILITY_EMPTY_TYPE = 5001;
    • SHIPMENT_TYPE_INCOMPATIBILITY_LESS_THAN_TWO_TYPES = 5002;
    • SHIPMENT_TYPE_INCOMPATIBILITY_DUPLICATE_TYPE = 5003;
    • SHIPMENT_TYPE_INCOMPATIBILITY_INVALID_INCOMPATIBILITY_MODE = 5004;
    • SHIPMENT_TYPE_INCOMPATIBILITY_TOO_MANY_INCOMPATIBILITIES = 5005;
  • SHIPMENT_TYPE_REQUIREMENT_ERROR = 52;
    • SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE = 52001;
    • SHIPMENT_TYPE_REQUIREMENT_NO_DEPENDENT_TYPE = 52002;
    • SHIPMENT_TYPE_REQUIREMENT_INVALID_REQUIREMENT_MODE = 52003;
    • SHIPMENT_TYPE_REQUIREMENT_TOO_MANY_REQUIREMENTS = 52004;
    • SHIPMENT_TYPE_REQUIREMENT_EMPTY_REQUIRED_TYPE = 52005;
    • SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_REQUIRED_TYPE = 52006;
    • SHIPMENT_TYPE_REQUIREMENT_NO_REQUIRED_TYPE_FOUND = 52007;
    • SHIPMENT_TYPE_REQUIREMENT_EMPTY_DEPENDENT_TYPE = 52008;
    • SHIPMENT_TYPE_REQUIREMENT_DUPLICATE_DEPENDENT_TYPE = 52009;
    • SHIPMENT_TYPE_REQUIREMENT_SELF_DEPENDENT_TYPE = 52010;
    • SHIPMENT_TYPE_REQUIREMENT_GRAPH_HAS_CYCLES = 52011;
  • VEHICLE_OPERATOR_ERROR = 54;
    • VEHICLE_OPERATOR_EMPTY_TYPE = 5400;
    • VEHICLE_OPERATOR_MULTIPLE_START_TIME_WINDOWS = 5401;
    • VEHICLE_OPERATOR_SOFT_START_TIME_WINDOW = 5402;
    • VEHICLE_OPERATOR_MULTIPLE_END_TIME_WINDOWS = 5403;
    • VEHICLE_OPERATOR_SOFT_END_TIME_WINDOW = 5404;
  • DURATION_SECONDS_MATRIX_ERROR = 56;
    • DURATION_SECONDS_MATRIX_DURATION_NEGATIVE_OR_NAN = 5600;
    • DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION = 5601;
displayName

string

The error display name.

fields[]

object (FieldReference)

An error context may involve 0, 1 (most of the time) or more fields. For example, referring to vehicle #4 and shipment #2's first pickup can be done as follows:

fields { name: "vehicles" index: 4}
fields { name: "shipments" index: 2 subField {name: "pickups" index: 0} }

Note, however, that the cardinality of fields should not change for a given error code.

errorMessage

string

Human-readable string describing the error. There is a 1:1 mapping between code and errorMessage (when code != "UNSPECIFIED").

STABILITY: Not stable: the error message associated to a given code may change (hopefully to clarify it) over time. Please rely on the displayName and code instead.

offendingValues

string

May contain the value(s) of the field(s). This is not always available. You should absolutely not rely on it and use it only for manual model debugging.

FieldReference

Specifies a context for the validation error. A FieldReference always refers to a given field in this file and follows the same hierarchical structure. For example, we may specify element #2 of startTimeWindows of vehicle #5 using:

name: "vehicles" index: 5 subField { name: "endTimeWindows" index: 2 }

We however omit top-level entities such as OptimizeToursRequest or ShipmentModel to avoid crowding the message.

JSON representation
{
  "name": string,
  "subField": {
    object (FieldReference)
  },

  // Union field index_or_key can be only one of the following:
  "index": integer,
  "key": string
  // End of list of possible types for union field index_or_key.
}
Fields
name

string

Name of the field, e.g., "vehicles".

subField

object (FieldReference)

Recursively nested sub-field, if needed.

Union field index_or_key.

index_or_key can be only one of the following:

index

integer

Index of the field if repeated.

key

string

Key if the field is a map.

Metrics

Overall metrics, aggregated over all routes.

JSON representation
{
  "aggregatedRouteMetrics": {
    object (AggregatedMetrics)
  },
  "skippedMandatoryShipmentCount": integer,
  "usedVehicleCount": integer,
  "earliestVehicleStartTime": string,
  "latestVehicleEndTime": string,
  "costs": {
    string: number,
    ...
  },
  "totalCost": number
}
Fields
aggregatedRouteMetrics

object (AggregatedMetrics)

Aggregated over the routes. Each metric is the sum (or max, for loads) over all ShipmentRoute.metrics fields of the same name.

skippedMandatoryShipmentCount

integer

Number of mandatory shipments skipped.

usedVehicleCount

integer

Number of vehicles used. Note: if a vehicle route is empty and Vehicle.used_if_route_is_empty is true, the vehicle is considered used.

earliestVehicleStartTime

string (Timestamp format)

The earliest start time for a used vehicle, computed as the minimum over all used vehicles of ShipmentRoute.vehicle_start_time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

latestVehicleEndTime

string (Timestamp format)

The latest end time for a used vehicle, computed as the maximum over all used vehicles of ShipmentRoute.vehicle_end_time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

costs

map (key: string, value: number)

Cost of the solution, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole solution. In other words, costs["model.shipments.pickups.cost"] is the sum of all pickup costs over the solution. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.

totalCost

number

Total cost of the solution. The sum of all values in the costs map.

SolutionMetadata

Metadata for solutions.

JSON representation
{
  "optimizer": string,
  "optimizationStartTime": string
}
Fields
optimizer

string

The name of the optimizer that generated this solution.

optimizationStartTime

string (Timestamp format)

The timestamp that this run of optimization started. The changes of entities (e.g. shipments and vehicles) after this are not captured in generating this solution.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

Methods

delete

Deletes a solution.

get

Gets a solution.

list

List the solutions based on certain conditions.

retrieveInput

Retrieves the OptimizeToursRequest that corresponds to the solution.