Service Client: Google::Cloud::Optimization::V1::FleetRouting::FleetRoutingClient
Client stub representing the remote FleetRouting gRPC service. Delegates call dispatching to Google::gRPC::Client.
target
The endpoint target address. Defaults to optimization.googleapis.com:443.
credentials
The authentication credentials provider. Defaults to application default credentials via Google::Auth.
NAME
Google::Cloud::Optimization::V1::FleetRouting - Compiled Protocol Buffers messages for google/cloud/optimization/v1/fleet_routing.proto
SYNOPSIS
use Google::Cloud::Optimization::V1::FleetRouting;
my $msg = Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursRequest->new({
parent => $parent,
timeout => $timeout,
model => $model,
solving_mode => $solving_mode,
});
# Read or update a field
my $val = $msg->parent();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/optimization/v1/fleet_routing.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursRequest
Request to be given to a tour optimization solver which defines the shipment model to solve as well as optimization parameters.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no location is specified, a region will be chosen automatically.
$msg->timeout()/$msg->timeout($value)Type:
Message(Google::Protobuf::Duration::Duration)If this timeout is set, the server returns a response before the timeout period has elapsed or the server deadline for synchronous requests is reached, whichever is sooner.
For asynchronous requests, the server will generate a solution (if possible) before the timeout has elapsed.
$msg->model()/$msg->model($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentModel)Shipment model to solve.
$msg->solving_mode()/$msg->solving_mode($value)Type:
Enum(Google::Cloud::Optimization::V1::OptimizeToursRequest::SolvingMode)By default, the solving mode is `DEFAULT_SOLVE` (0).
$msg->search_mode()/$msg->search_mode($value)Type:
Enum(Google::Cloud::Optimization::V1::OptimizeToursRequest::SearchMode)Search mode used to solve the request.
$msg->injected_first_solution_routes()/$msg->injected_first_solution_routes($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute)Guide the optimization algorithm in finding a first solution that is similar to a previous solution.
The model is constrained when the first solution is built. Any shipments not performed on a route are implicitly skipped in the first solution, but they may be performed in successive solutions.
The solution must satisfy some basic validity assumptions:
* for all routes, `vehicle_index` must be in range and not be duplicated. * for all visits, `shipment_index` and `visit_request_index` must be in range. * a shipment may only be referenced on one route. * the pickup of a pickup-delivery shipment must be performed before the delivery. * no more than one pickup alternative or delivery alternative of a shipment may be performed. * for all routes, times are increasing (i.e., `vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time`). * a shipment may only be performed on a vehicle that is allowed. A vehicle is allowed if [Shipment.allowed_vehicle_indices][google.cloud.optimization.v1.Shipment.allowed_vehicle_indices] is empty or its `vehicle_index` is included in [Shipment.allowed_vehicle_indices][google.cloud.optimization.v1.Shipment.allowed_vehicle_indices].If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.
$msg->injected_solution_constraint()/$msg->injected_solution_constraint($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::InjectedSolutionConstraint)Constrain the optimization algorithm to find a final solution that is similar to a previous solution. For example, this may be used to freeze portions of routes which have already been completed or which are to be completed but must not be modified.
If the injected solution is not feasible, a validation error is not necessarily returned and an error indicating infeasibility may be returned instead.
$msg->refresh_details_routes()/$msg->refresh_details_routes($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute)If non-empty, the given routes will be refreshed, without modifying their underlying sequence of visits or travel times: only other details will be updated. This does not solve the model.
As of 2020/11, this only populates the polylines of non-empty routes and requires that `populate_polylines` is true.
The `route_polyline` fields of the passed-in routes may be inconsistent with route `transitions`.
This field must not be used together with `injected_first_solution_routes` or `injected_solution_constraint`.
`Shipment.ignore` and `Vehicle.ignore` have no effect on the behavior. Polylines are still populated between all visits in all non-empty routes regardless of whether the related shipments or vehicles are ignored.
$msg->interpret_injected_solutions_using_labels()/$msg->interpret_injected_solutions_using_labels($value)Type:
BoolIf true:
* uses [ShipmentRoute.vehicle_label][google.cloud.optimization.v1.ShipmentRoute.vehicle_label] instead of `vehicle_index` to match routes in an injected solution with vehicles in the request; reuses the mapping of original [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index] to new [ShipmentRoute.vehicle_index][google.cloud.optimization.v1.ShipmentRoute.vehicle_index] to update [ConstraintRelaxation.vehicle_indices][google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.vehicle_indices] if non-empty, but the mapping must be unambiguous (i.e., multiple `ShipmentRoute`s must not share the same original `vehicle_index`). * uses [ShipmentRoute.Visit.shipment_label][google.cloud.optimization.v1.ShipmentRoute.Visit.shipment_label] instead of `shipment_index` to match visits in an injected solution with shipments in the request; * uses [SkippedShipment.label][google.cloud.optimization.v1.SkippedShipment.label] instead of [SkippedShipment.index][google.cloud.optimization.v1.SkippedShipment.index] to match skipped shipments in the injected solution with request shipments.This interpretation applies to the `injected_first_solution_routes`, `injected_solution_constraint`, and `refresh_details_routes` fields. It can be used when shipment or vehicle indices in the request have changed since the solution was created, perhaps because shipments or vehicles have been removed from or added to the request.
If true, labels in the following categories must appear at most once in their category:
* [Vehicle.label][google.cloud.optimization.v1.Vehicle.label] in the request; * [Shipment.label][google.cloud.optimization.v1.Shipment.label] in the request; * [ShipmentRoute.vehicle_label][google.cloud.optimization.v1.ShipmentRoute.vehicle_label] in the injected solution; * [SkippedShipment.label][google.cloud.optimization.v1.SkippedShipment.label] and [ShipmentRoute.Visit.shipment_label][google.cloud.optimization.v1.ShipmentRoute.Visit.shipment_label] in the injected solution (except pickup/delivery visit pairs, whose `shipment_label` must appear twice).If a `vehicle_label` in the injected solution does not correspond to a request vehicle, the corresponding route is removed from the solution along with its visits. If a `shipment_label` in the injected solution does not correspond to a request shipment, the corresponding visit is removed from the solution. If a [SkippedShipment.label][google.cloud.optimization.v1.SkippedShipment.label] in the injected solution does not correspond to a request shipment, the `SkippedShipment` is removed from the solution.
Removing route visits or entire routes from an injected solution may have an effect on the implied constraints, which may lead to change in solution, validation errors, or infeasibility.
NOTE: The caller must ensure that each [Vehicle.label][google.cloud.optimization.v1.Vehicle.label] (resp. [Shipment.label][google.cloud.optimization.v1.Shipment.label]) uniquely identifies a vehicle (resp. shipment) entity used across the two relevant requests: the past request that produced the `OptimizeToursResponse` used in the injected solution and the current request that includes the injected solution. The uniqueness checks described above are not enough to guarantee this requirement.
$msg->consider_road_traffic()/$msg->consider_road_traffic($value)Type:
BoolConsider traffic estimation in calculating `ShipmentRoute` fields [Transition.travel_duration][google.cloud.optimization.v1.ShipmentRoute.Transition.travel_duration], [Visit.start_time][google.cloud.optimization.v1.ShipmentRoute.Visit.start_time], and `vehicle_end_time`; in setting the [ShipmentRoute.has_traffic_infeasibilities][google.cloud.optimization.v1.ShipmentRoute.has_traffic_infeasibilities] field, and in calculating the [OptimizeToursResponse.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.total_cost] field.
$msg->populate_polylines()/$msg->populate_polylines($value)Type:
BoolIf true, polylines will be populated in response `ShipmentRoute`s.
$msg->populate_transition_polylines()/$msg->populate_transition_polylines($value)Type:
BoolIf true, polylines will be populated in response [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions]. Note that in this case, the polylines will also be populated in the deprecated `travel_steps`.
$msg->allow_large_deadline_despite_interruption_risk()/$msg->allow_large_deadline_despite_interruption_risk($value)Type:
BoolIf this is set, then the request can have a deadline (see https://grpc.io/blog/deadlines) of up to 60 minutes. Otherwise, the maximum deadline is only 30 minutes. Note that long-lived requests have a significantly larger (but still small) risk of interruption.
$msg->use_geodesic_distances()/$msg->use_geodesic_distances($value)Type:
BoolIf true, travel distances will be computed using geodesic distances instead of Google Maps distances, and travel times will be computed using geodesic distances with a speed defined by `geodesic_meters_per_second`.
$msg->geodesic_meters_per_second()/$msg->geodesic_meters_per_second($value)Type:
DoubleWhen `use_geodesic_distances` is true, this field must be set and defines the speed applied to compute travel times. Its value must be at least 1.0 meters/seconds.
$msg->max_validation_errors()/$msg->max_validation_errors($value)Type:
Int32Truncates the number of validation errors returned. These errors are typically attached to an INVALID_ARGUMENT error payload as a BadRequest error detail (https://cloud.google.com/apis/design/errors#error_details), unless solving_mode=VALIDATE_ONLY: see the [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] field. This defaults to 100 and is capped at 10,000.
$msg->label()/$msg->label($value)Type:
StringLabel that may be used to identify this request, reported back in the [OptimizeToursResponse.request_label][google.cloud.optimization.v1.OptimizeToursResponse.request_label].
$msg->populate_travel_step_polylines()/$msg->populate_travel_step_polylines($value)Type:
BoolDeprecated: Use [OptimizeToursRequest.populate_transition_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines] instead. If true, polylines will be populated in response [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions]. Note that in this case, the polylines will also be populated in the deprecated `travel_steps`.
Enum: OptimizeToursRequest::SolvingMode
DEFAULT_SOLVE=>0VALIDATE_ONLY=>1DETECT_SOME_INFEASIBLE_SHIPMENTS=>2
Enum: OptimizeToursRequest::SearchMode
SEARCH_MODE_UNSPECIFIED=>0RETURN_FAST=>1CONSUME_ALL_AVAILABLE_TIME=>2
Google::Cloud::Optimization::V1::FleetRouting::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.
Inherits from Protobuf::Message.
Accessors
$msg->routes()/$msg->routes($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute)Routes computed for each vehicle; the i-th route corresponds to the i-th vehicle in the model.
$msg->request_label()/$msg->request_label($value)Type:
StringCopy of the [OptimizeToursRequest.label][google.cloud.optimization.v1.OptimizeToursRequest.label], if a label was specified in the request.
$msg->skipped_shipments()/$msg->skipped_shipments($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::SkippedShipment)The list of all shipments skipped.
$msg->validation_errors()/$msg->validation_errors($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursValidationError)List of all the validation errors that we were able to detect independently. See the "MULTIPLE ERRORS" explanation for the [OptimizeToursValidationError][google.cloud.optimization.v1.OptimizeToursValidationError] message.
$msg->metrics()/$msg->metrics($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursResponse::Metrics)Duration, distance and usage metrics for this solution.
$msg->total_cost()/$msg->total_cost($value)Type:
DoubleDeprecated: Use [Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.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.
Google::Cloud::Optimization::V1::FleetRouting::BatchOptimizeToursRequest
Request to batch optimize tours as an asynchronous operation. Each input file should contain one `OptimizeToursRequest`, and each output file will contain one `OptimizeToursResponse`. The request contains information to read/write and parse the files. All the input and output files should be under the same project.
Inherits from Protobuf::Message.
Accessors
$msg->parent()/$msg->parent($value)Type:
StringRequired. Target project and location to make a call.
Format: `projects/{project-id}/locations/{location-id}`.
If no location is specified, a region will be chosen automatically.
$msg->model_configs()/$msg->model_configs($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::BatchOptimizeToursRequest::AsyncModelConfig)Required. Input/Output information each purchase model, such as file paths and data formats.
Google::Cloud::Optimization::V1::FleetRouting::BatchOptimizeToursResponse
Response to a `BatchOptimizeToursRequest`. This is returned in the LRO Operation after the operation is complete.
Inherits from Protobuf::Message.
Google::Cloud::Optimization::V1::FleetRouting::ShipmentModel
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
Inherits from Protobuf::Message.
Accessors
$msg->shipments()/$msg->shipments($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Shipment)Set of shipments which must be performed in the model.
$msg->vehicles()/$msg->vehicles($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Vehicle)Set of vehicles which can be used to perform visits.
$msg->max_active_vehicles()/$msg->max_active_vehicles($value)Type:
Int32Constrains 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.
$msg->global_start_time()/$msg->global_start_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)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 `global_end_time` and the `global_start_time` must be within 31536000 seconds of each other.
When using `cost_per_*hour` fields, you might want to set this window to a smaller interval to increase performance (eg. if you model a single day, you should set the global time limits to that day). If unset, 00:00:00 UTC, January 1, 1970 (i.e. seconds: 0, nanos: 0) is used as default.
$msg->global_end_time()/$msg->global_end_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)If unset, 00:00:00 UTC, January 1, 1971 (i.e. seconds: 31536000, nanos: 0) is used as default.
$msg->global_duration_cost_per_hour()/$msg->global_duration_cost_per_hour($value)Type:
DoubleThe "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 [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
$msg->duration_distance_matrices()/$msg->duration_distance_matrices($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentModel::DurationDistanceMatrix)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 `use_geodesic_distances` field. If it is not empty, `use_geodesic_distances` cannot be true and neither `duration_distance_matrix_src_tags` nor `duration_distance_matrix_dst_tags` can be empty.
Usage examples:
* There are two locations: locA and locB. * 1 vehicle starting its route at locA and ending it at locA. * 1 pickup visit request at locB.
``` model { vehicles { start_tags: "locA" end_tags: "locA" } shipments { pickups { tags: "locB" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_dst_tags: "locA" duration_distance_matrix_dst_tags: "locB" duration_distance_matrices { rows { # from: locA durations { seconds: 0 } meters: 0 # to: locA durations { seconds: 100 } meters: 1000 # to: locB } rows { # from: locB durations { seconds: 102 } meters: 990 # to: locA durations { seconds: 0 } meters: 0 # to: locB } } } ```
* There are three locations: locA, locB and locC. * 1 vehicle starting its route at locA and ending it at locB, using matrix "fast". * 1 vehicle starting its route at locB and ending it at locB, using matrix "slow". * 1 vehicle starting its route at locB and ending it at locB, using matrix "fast". * 1 pickup visit request at locC.
``` model { vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" } vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" } shipments { pickups { tags: "locC" } } duration_distance_matrix_src_tags: "locA" duration_distance_matrix_src_tags: "locB" duration_distance_matrix_src_tags: "locC" duration_distance_matrix_dst_tags: "locB" duration_distance_matrix_dst_tags: "locC" duration_distance_matrices { vehicle_start_tag: "fast" rows { # from: locA durations { seconds: 1000 } meters: 2000 # to: locB durations { seconds: 600 } meters: 1000 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 700 } meters: 1200 # to: locC } rows { # from: locC durations { seconds: 702 } meters: 1190 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } duration_distance_matrices { vehicle_start_tag: "slow" rows { # from: locA durations { seconds: 1800 } meters: 2001 # to: locB durations { seconds: 900 } meters: 1002 # to: locC } rows { # from: locB durations { seconds: 0 } meters: 0 # to: locB durations { seconds: 1000 } meters: 1202 # to: locC } rows { # from: locC durations { seconds: 1001 } meters: 1195 # to: locB durations { seconds: 0 } meters: 0 # to: locC } } } ```
$msg->duration_distance_matrix_src_tags()/$msg->duration_distance_matrix_src_tags($value)Type:
StringTags defining the sources of the duration and distance matrices; `duration_distance_matrices(i).rows(j)` defines durations and distances from visits with tag `duration_distance_matrix_src_tags(j)` to other visits in matrix i.
Tags correspond to [VisitRequest.tags][google.cloud.optimization.v1.Shipment.VisitRequest.tags] or [Vehicle.start_tags][google.cloud.optimization.v1.Vehicle.start_tags]. A given `VisitRequest` or `Vehicle` must match exactly one tag in this field. Note that a `Vehicle`'s source, destination and matrix tags may be the same; similarly a `VisitRequest`'s source and destination tags may be the same. All tags must be different and cannot be empty strings. If this field is not empty, then `duration_distance_matrices` must not be empty.
$msg->duration_distance_matrix_dst_tags()/$msg->duration_distance_matrix_dst_tags($value)Type:
StringTags defining the destinations of the duration and distance matrices; `duration_distance_matrices(i).rows(j).durations(k)` (resp. `duration_distance_matrices(i).rows(j).meters(k))` defines the duration (resp. the distance) of the travel from visits with tag `duration_distance_matrix_src_tags(j)` to visits with tag `duration_distance_matrix_dst_tags(k)` in matrix i.
Tags correspond to [VisitRequest.tags][google.cloud.optimization.v1.Shipment.VisitRequest.tags] or [Vehicle.start_tags][google.cloud.optimization.v1.Vehicle.start_tags]. A given `VisitRequest` or `Vehicle` must match exactly one tag in this field. Note that a `Vehicle`'s source, destination and matrix tags may be the same; similarly a `VisitRequest`'s source and destination tags may be the same. All tags must be different and cannot be empty strings. If this field is not empty, then `duration_distance_matrices` must not be empty.
$msg->transition_attributes()/$msg->transition_attributes($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::TransitionAttributes)Transition attributes added to the model.
$msg->shipment_type_incompatibilities()/$msg->shipment_type_incompatibilities($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentTypeIncompatibility)Sets of incompatible shipment_types (see `ShipmentTypeIncompatibility`).
$msg->shipment_type_requirements()/$msg->shipment_type_requirements($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentTypeRequirement)Sets of `shipment_type` requirements (see `ShipmentTypeRequirement`).
$msg->precedence_rules()/$msg->precedence_rules($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentModel::PrecedenceRule)Set of precedence rules which must be enforced in the model.
$msg->break_rules()/$msg->break_rules($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentModel::BreakRule)Deprecated: No longer used. Set of break rules used in the model. Each vehicle specifies the `BreakRule` that applies to it via the [Vehicle.break_rule_indices][google.cloud.optimization.v1.Vehicle.break_rule_indices] field (which must be a singleton).
Google::Cloud::Optimization::V1::FleetRouting::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).
Inherits from Protobuf::Message.
Accessors
$msg->pickups()/$msg->pickups($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Shipment::VisitRequest)Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.
$msg->deliveries()/$msg->deliveries($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Shipment::VisitRequest)Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups.
$msg->load_demands()/$msg->load_demands($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Shipment::LoadDemandsEntry)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.
$msg->penalty_cost()/$msg->penalty_cost($value)Type:
DoubleIf 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.
$msg->allowed_vehicle_indices()/$msg->allowed_vehicle_indices($value)Type:
Int32The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the `ShipmentModel`'s `vehicles` list.
$msg->costs_per_vehicle()/$msg->costs_per_vehicle($value)Type:
DoubleSpecifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:
* the same number of elements as `costs_per_vehicle_indices`. `costs_per_vehicle[i]` corresponds to vehicle `costs_per_vehicle_indices[i]` of the model. * the same number of elements as there are vehicles in the model. The i-th element corresponds to vehicle #i of the model.These costs must be in the same unit as `penalty_cost` and must not be negative. Leave this field empty, if there are no such costs.
$msg->costs_per_vehicle_indices()/$msg->costs_per_vehicle_indices($value)Type:
Int32Indices of the vehicles to which `costs_per_vehicle` applies. If non-empty, it must have the same number of elements as `costs_per_vehicle`. A vehicle index may not be specified more than once. If a vehicle is excluded from `costs_per_vehicle_indices`, its cost is zero.
$msg->pickup_to_delivery_relative_detour_limit()/$msg->pickup_to_delivery_relative_detour_limit($value)Type:
DoubleSpecifies 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 `pickup_to_delivery_relative_detour_limit` enforces:
``` start_time(delivery) - start_time(pickup) <= std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit)) ```
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.
$msg->pickup_to_delivery_absolute_detour_limit()/$msg->pickup_to_delivery_absolute_detour_limit($value)Type:
Message(Google::Protobuf::Duration::Duration)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 `pickup_to_delivery_absolute_detour_limit` enforces:
``` start_time(delivery) - start_time(pickup) <= t + pickup_to_delivery_absolute_detour_limit ```
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.
$msg->pickup_to_delivery_time_limit()/$msg->pickup_to_delivery_time_limit($value)Type:
Message(Google::Protobuf::Duration::Duration)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.
$msg->shipment_type()/$msg->shipment_type($value)Type:
StringNon-empty string specifying a "type" for this shipment. This feature can be used to define incompatibilities or requirements between `shipment_types` (see `shipment_type_incompatibilities` and `shipment_type_requirements` in `ShipmentModel`).
Differs from `visit_types` which is specified for a single visit: All pickup/deliveries belonging to the same shipment share the same `shipment_type`.
$msg->label()/$msg->label($value)Type:
StringSpecifies a label for this shipment. This label is reported in the response in the `shipment_label` of the corresponding [ShipmentRoute.Visit][google.cloud.optimization.v1.ShipmentRoute.Visit].
$msg->ignore()/$msg->ignore($value)Type:
BoolIf true, skip this shipment, but don't apply a `penalty_cost`.
Ignoring a shipment results in a validation error when there are any `shipment_type_requirements` in the model.
Ignoring a shipment that is performed in `injected_first_solution_routes` or `injected_solution_constraint` is permitted; the solver removes the related pickup/delivery visits from the performing route. `precedence_rules` that reference ignored shipments will also be ignored.
$msg->demands()/$msg->demands($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantity)Deprecated: Use [Shipment.load_demands][google.cloud.optimization.v1.Shipment.load_demands] instead.
Google::Cloud::Optimization::V1::FleetRouting::ShipmentTypeIncompatibility
Specifies incompatibilties between shipments depending on their shipment_type. The appearance of incompatible shipments on the same route is restricted based on the incompatibility mode.
Inherits from Protobuf::Message.
Accessors
$msg->types()/$msg->types($value)Type:
StringList of incompatible types. Two shipments having different `shipment_types` among those listed are "incompatible".
$msg->incompatibility_mode()/$msg->incompatibility_mode($value)Type:
Enum(Google::Cloud::Optimization::V1::ShipmentTypeIncompatibility::IncompatibilityMode)Mode applied to the incompatibility.
Enum: ShipmentTypeIncompatibility::IncompatibilityMode
INCOMPATIBILITY_MODE_UNSPECIFIED=>0NOT_PERFORMED_BY_SAME_VEHICLE=>1NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY=>2
Google::Cloud::Optimization::V1::FleetRouting::ShipmentTypeRequirement
Specifies requirements between shipments based on their shipment_type. The specifics of the requirement are defined by the requirement mode.
Inherits from Protobuf::Message.
Accessors
$msg->required_shipment_type_alternatives()/$msg->required_shipment_type_alternatives($value)Type:
StringList of alternative shipment types required by the `dependent_shipment_types`.
$msg->dependent_shipment_types()/$msg->dependent_shipment_types($value)Type:
StringAll shipments with a type in the `dependent_shipment_types` field require at least one shipment of type `required_shipment_type_alternatives` to be visited on the same route.
NOTE: Chains of requirements such that a `shipment_type` depends on itself are not allowed.
$msg->requirement_mode()/$msg->requirement_mode($value)Type:
Enum(Google::Cloud::Optimization::V1::ShipmentTypeRequirement::RequirementMode)Mode applied to the requirement.
Enum: ShipmentTypeRequirement::RequirementMode
REQUIREMENT_MODE_UNSPECIFIED=>0PERFORMED_BY_SAME_VEHICLE=>1IN_SAME_VEHICLE_AT_PICKUP_TIME=>2IN_SAME_VEHICLE_AT_DELIVERY_TIME=>3
Google::Cloud::Optimization::V1::FleetRouting::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.
Inherits from Protobuf::Message.
Accessors
$msg->avoid_tolls()/$msg->avoid_tolls($value)Type:
BoolSpecifies whether to avoid toll roads where reasonable. Preference will be given to routes not containing toll roads. Applies only to motorized travel modes.
$msg->avoid_highways()/$msg->avoid_highways($value)Type:
BoolSpecifies whether to avoid highways where reasonable. Preference will be given to routes not containing highways. Applies only to motorized travel modes.
$msg->avoid_ferries()/$msg->avoid_ferries($value)Type:
BoolSpecifies whether to avoid ferries where reasonable. Preference will be given to routes not containing travel by ferries. Applies only to motorized travel modes.
$msg->avoid_indoor()/$msg->avoid_indoor($value)Type:
BoolOptional. Specifies whether to avoid navigating indoors where reasonable. Preference will be given to routes not containing indoor navigation. Applies only to the `WALKING` travel mode.
Google::Cloud::Optimization::V1::FleetRouting::Vehicle
Models a vehicle in a shipment problem. Solving a shipment problem will build a route starting from `start_location` and ending at `end_location` for this vehicle. A route is a sequence of visits (see `ShipmentRoute`).
Inherits from Protobuf::Message.
Accessors
$msg->travel_mode()/$msg->travel_mode($value)Type:
Enum(Google::Cloud::Optimization::V1::Vehicle::TravelMode)The travel mode which affects the roads usable by the vehicle and its speed. See also `travel_duration_multiple`.
$msg->route_modifiers()/$msg->route_modifiers($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::RouteModifiers)Optional. A set of conditions to satisfy that affect the way routes are calculated for the given vehicle.
$msg->start_location()/$msg->start_location($value)Type:
Message(Google::Type::Latlng::LatLng)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, `start_location` must not be specified.
$msg->start_waypoint()/$msg->start_waypoint($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Waypoint)Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither `start_waypoint` nor `start_location` is specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, `start_waypoint` must not be specified.
$msg->end_location()/$msg->end_location($value)Type:
Message(Google::Type::Latlng::LatLng)Geographic location where the vehicle ends after it has completed its last `VisitRequest`. If not specified the vehicle's `ShipmentRoute` ends immediately when it completes its last `VisitRequest`. If the shipment model has duration and distance matrices, `end_location` must not be specified.
$msg->end_waypoint()/$msg->end_waypoint($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Waypoint)Waypoint representing a geographic location where the vehicle ends after it has completed its last `VisitRequest`. If neither `end_waypoint` nor `end_location` is specified, the vehicle's `ShipmentRoute` ends immediately when it completes its last `VisitRequest`. If the shipment model has duration and distance matrices, `end_waypoint` must not be specified.
$msg->start_tags()/$msg->start_tags($value)Type:
StringSpecifies tags attached to the start of the vehicle's route.
Empty or duplicate strings are not allowed.
$msg->end_tags()/$msg->end_tags($value)Type:
StringSpecifies tags attached to the end of the vehicle's route.
Empty or duplicate strings are not allowed.
$msg->start_time_windows()/$msg->start_time_windows($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::TimeWindow)Time windows during which the vehicle may depart its start location. They must be within the global time limits (see [ShipmentModel.global_*][google.cloud.optimization.v1.ShipmentModel.global_start_time] fields). If unspecified, there is no limitation besides those global time limits.
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.
`cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if there is a single time window.
$msg->end_time_windows()/$msg->end_time_windows($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::TimeWindow)Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see [ShipmentModel.global_*][google.cloud.optimization.v1.ShipmentModel.global_start_time] fields). If unspecified, there is no limitation besides those global time limits.
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.
`cost_per_hour_after_soft_end_time` and `soft_end_time` can only be set if there is a single time window.
$msg->travel_duration_multiple()/$msg->travel_duration_multiple($value)Type:
DoubleSpecifies 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 `cost_per_hour` or `cost_per_traveled_hour` are specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle is standard, and this multiple is considered 1.0.
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 `extra_visit_duration_for_visit_type` below.
$msg->unloading_policy()/$msg->unloading_policy($value)Type:
Enum(Google::Cloud::Optimization::V1::Vehicle::UnloadingPolicy)Unloading policy enforced on the vehicle.
$msg->load_limits()/$msg->load_limits($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Vehicle::LoadLimitsEntry)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 [Shipment.load_demands][google.cloud.optimization.v1.Shipment.load_demands] field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.
$msg->cost_per_hour()/$msg->cost_per_hour($value)Type:
DoubleVehicle costs: all costs add up and must be in the same unit as [Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
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 `cost_per_hour` instead of just `cost_per_traveled_hour` may result in additional latency.
$msg->cost_per_traveled_hour()/$msg->cost_per_traveled_hour($value)Type:
DoubleCost per traveled hour of the vehicle route. This cost is applied only to travel time taken by the route (i.e., that reported in [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions]), and excludes waiting time and visit time.
$msg->cost_per_kilometer()/$msg->cost_per_kilometer($value)Type:
DoubleCost per kilometer of the vehicle route. This cost is applied to the distance reported in the [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions] and does not apply to any distance implicitly traveled from the `arrival_location` to the `departure_location` of a single `VisitRequest`.
$msg->fixed_cost()/$msg->fixed_cost($value)Type:
DoubleFixed cost applied if this vehicle is used to handle a shipment.
$msg->used_if_route_is_empty()/$msg->used_if_route_is_empty($value)Type:
BoolThis 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 `break_rule` or delay (from `TransitionAttributes`) are scheduled for this vehicle. In this case, the vehicle's `ShipmentRoute` doesn't contain any information except for the vehicle index and label.
$msg->route_duration_limit()/$msg->route_duration_limit($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Vehicle::DurationLimit)Limit applied to the total duration of the vehicle's route. In a given `OptimizeToursResponse`, the route duration of a vehicle is the difference between its `vehicle_end_time` and `vehicle_start_time`.
$msg->travel_duration_limit()/$msg->travel_duration_limit($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Vehicle::DurationLimit)Limit applied to the travel duration of the vehicle's route. In a given `OptimizeToursResponse`, the route travel duration is the sum of all its [transitions.travel_duration][google.cloud.optimization.v1.ShipmentRoute.Transition.travel_duration].
$msg->route_distance_limit()/$msg->route_distance_limit($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::DistanceLimit)Limit applied to the total distance of the vehicle's route. In a given `OptimizeToursResponse`, the route distance is the sum of all its [transitions.travel_distance_meters][google.cloud.optimization.v1.ShipmentRoute.Transition.travel_distance_meters].
$msg->extra_visit_duration_for_visit_type()/$msg->extra_visit_duration_for_visit_type($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Vehicle::ExtraVisitDurationForVisitTypeEntry)Specifies a map from visit_types strings to durations. The duration is time in addition to [VisitRequest.duration][google.cloud.optimization.v1.Shipment.VisitRequest.duration] to be taken at visits with the specified `visit_types`. This extra visit duration adds cost if `cost_per_hour` is specified. Keys (i.e. `visit_types`) cannot be empty strings.
If a visit request has multiple types, a duration will be added for each type in the map.
$msg->break_rule()/$msg->break_rule($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::BreakRule)Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle.
$msg->label()/$msg->label($value)Type:
StringSpecifies a label for this vehicle. This label is reported in the response as the `vehicle_label` of the corresponding [ShipmentRoute][google.cloud.optimization.v1.ShipmentRoute].
$msg->ignore()/$msg->ignore($value)Type:
BoolIf true, `used_if_route_is_empty` must be false, and this vehicle will remain unused.
If a shipment is performed by an ignored vehicle in `injected_first_solution_routes`, it is skipped in the first solution but is free to be performed in the response.
If a shipment is performed by an ignored vehicle in `injected_solution_constraint` and any related pickup/delivery is constrained to remain on the vehicle (i.e., not relaxed to level `RELAX_ALL_AFTER_THRESHOLD`), it is skipped in the response. If a shipment has a non-empty `allowed_vehicle_indices` field and all of the allowed vehicles are ignored, it is skipped in the response.
$msg->break_rule_indices()/$msg->break_rule_indices($value)Type:
Int32Deprecated: No longer used. Indices in the `break_rule` field in the source [ShipmentModel][google.cloud.optimization.v1.ShipmentModel]. They correspond to break rules enforced on the vehicle.
As of 2018/03, at most one rule index per vehicle can be specified.
$msg->capacities()/$msg->capacities($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantity)Deprecated: Use [Vehicle.load_limits][google.cloud.optimization.v1.Vehicle.load_limits] instead.
$msg->start_load_intervals()/$msg->start_load_intervals($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantityInterval)Deprecated: Use [Vehicle.LoadLimit.start_load_interval][google.cloud.optimization.v1.Vehicle.LoadLimit.start_load_interval] instead.
$msg->end_load_intervals()/$msg->end_load_intervals($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantityInterval)Deprecated: Use [Vehicle.LoadLimit.end_load_interval][google.cloud.optimization.v1.Vehicle.LoadLimit.end_load_interval] instead.
Enum: Vehicle::TravelMode
TRAVEL_MODE_UNSPECIFIED=>0DRIVING=>1WALKING=>2
Enum: Vehicle::UnloadingPolicy
UNLOADING_POLICY_UNSPECIFIED=>0LAST_IN_FIRST_OUT=>1FIRST_IN_FIRST_OUT=>2
Google::Cloud::Optimization::V1::FleetRouting::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, `start_time` and `end_time`, enforce the earliest and latest time of the event, such that `start_time <= event_time <= end_time`. The soft time window lower bound, `soft_start_time`, expresses a preference for the event to happen at or after `soft_start_time` by incurring a cost proportional to how long before soft_start_time the event occurs. The soft time window upper bound, `soft_end_time`, expresses a preference for the event to happen at or before `soft_end_time` by incurring a cost proportional to how long after `soft_end_time` the event occurs. `start_time`, `end_time`, `soft_start_time` and `soft_end_time` should be within the global time limits (see [ShipmentModel.global_start_time][google.cloud.optimization.v1.ShipmentModel.global_start_time] and [ShipmentModel.global_end_time][google.cloud.optimization.v1.ShipmentModel.global_end_time]) and should respect: ``` 0 <= `start_time` <= `soft_start_time` <= `end_time` and 0 <= `start_time` <= `soft_end_time` <= `end_time`. ```
Inherits from Protobuf::Message.
Accessors
$msg->start_time()/$msg->start_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)The hard time window start time. If unspecified it will be set to `ShipmentModel.global_start_time`.
$msg->end_time()/$msg->end_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)The hard time window end time. If unspecified it will be set to `ShipmentModel.global_end_time`.
$msg->soft_start_time()/$msg->soft_start_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)The soft start time of the time window.
$msg->soft_end_time()/$msg->soft_end_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)The soft end time of the time window.
$msg->cost_per_hour_before_soft_start_time()/$msg->cost_per_hour_before_soft_start_time($value)Type:
DoubleA cost per hour added to other costs in the model if the event occurs before soft_start_time, computed as:
``` max(0, soft_start_time - t.seconds) * cost_per_hour_before_soft_start_time / 3600, t being the time of the event. ```
This cost must be positive, and the field can only be set if soft_start_time has been set.
$msg->cost_per_hour_after_soft_end_time()/$msg->cost_per_hour_after_soft_end_time($value)Type:
DoubleA cost per hour added to other costs in the model if the event occurs after `soft_end_time`, computed as:
``` max(0, t.seconds - soft_end_time.seconds) * cost_per_hour_after_soft_end_time / 3600, t being the time of the event. ```
This cost must be positive, and the field can only be set if `soft_end_time` has been set.
Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantity
Deprecated: Use [Vehicle.LoadLimit.Interval][google.cloud.optimization.v1.Vehicle.LoadLimit.Interval] instead.
Inherits from Protobuf::Message.
Accessors
$msg->type()/$msg->type($value)Type:
String$msg->value()/$msg->value($value)Type:
Int64
Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantityInterval
Deprecated: Use [Vehicle.LoadLimit.Interval][google.cloud.optimization.v1.Vehicle.LoadLimit.Interval] instead.
Inherits from Protobuf::Message.
Accessors
$msg->type()/$msg->type($value)Type:
String$msg->min_value()/$msg->min_value($value)Type:
Int64$msg->max_value()/$msg->max_value($value)Type:
Int64
Google::Cloud::Optimization::V1::FleetRouting::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 `soft_max_meters` and `cost_per_kilometer_above_soft_max` must be defined and be nonnegative.
Inherits from Protobuf::Message.
Accessors
$msg->max_meters()/$msg->max_meters($value)Type:
Int64A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.
$msg->soft_max_meters()/$msg->soft_max_meters($value)Type:
Int64A 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 soft_max_meters must be less than max_meters and must be nonnegative.
$msg->cost_per_kilometer_below_soft_max()/$msg->cost_per_kilometer_below_soft_max($value)Type:
DoubleCost per kilometer incurred, increasing up to `soft_max_meters`, with formula: ``` min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. ``` This cost is not supported in `route_distance_limit`.
$msg->cost_per_kilometer_above_soft_max()/$msg->cost_per_kilometer_above_soft_max($value)Type:
DoubleCost per kilometer incurred if distance is above `soft_max_meters` limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: ``` (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. ``` The cost must be nonnegative.
Google::Cloud::Optimization::V1::FleetRouting::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).
Inherits from Protobuf::Message.
Accessors
$msg->src_tag()/$msg->src_tag($value)Type:
StringTags defining the set of (src->dst) transitions these attributes apply to.
A source visit or vehicle start matches iff its [VisitRequest.tags][google.cloud.optimization.v1.Shipment.VisitRequest.tags] or [Vehicle.start_tags][google.cloud.optimization.v1.Vehicle.start_tags] either contains `src_tag` or does not contain `excluded_src_tag` (depending on which of these two fields is non-empty).
$msg->excluded_src_tag()/$msg->excluded_src_tag($value)Type:
StringSee `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be non-empty.
$msg->dst_tag()/$msg->dst_tag($value)Type:
StringA destination visit or vehicle end matches iff its [VisitRequest.tags][google.cloud.optimization.v1.Shipment.VisitRequest.tags] or [Vehicle.end_tags][google.cloud.optimization.v1.Vehicle.end_tags] either contains `dst_tag` or does not contain `excluded_dst_tag` (depending on which of these two fields is non-empty).
$msg->excluded_dst_tag()/$msg->excluded_dst_tag($value)Type:
StringSee `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be non-empty.
$msg->cost()/$msg->cost($value)Type:
DoubleSpecifies 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.
$msg->cost_per_kilometer()/$msg->cost_per_kilometer($value)Type:
DoubleSpecifies a cost per kilometer applied to the distance traveled while performing this transition. It adds up to any [Vehicle.cost_per_kilometer][google.cloud.optimization.v1.Vehicle.cost_per_kilometer] specified on vehicles.
$msg->distance_limit()/$msg->distance_limit($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::DistanceLimit)Specifies a limit on the distance traveled while performing this transition.
As of 2021/06, only soft limits are supported.
$msg->delay()/$msg->delay($value)Type:
Message(Google::Protobuf::Duration::Duration)Specifies a delay incurred when performing this transition.
This delay always occurs *after* finishing the source visit and *before* starting the destination visit.
Google::Cloud::Optimization::V1::FleetRouting::Waypoint
Encapsulates a waypoint. Waypoints mark arrival and departure locations of VisitRequests, and start and end locations of Vehicles.
Inherits from Protobuf::Message.
Accessors
$msg->location()/$msg->location($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::Location)A point specified using geographic coordinates, including an optional heading.
$msg->place_id()/$msg->place_id($value)Type:
StringThe POI Place ID associated with the waypoint.
$msg->side_of_road()/$msg->side_of_road($value)Type:
BoolIndicates 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 works only for the 'DRIVING' travel mode, and when the 'location_type' is set to 'location'.
Google::Cloud::Optimization::V1::FleetRouting::Location
Encapsulates a location (a geographic point, and an optional heading).
Inherits from Protobuf::Message.
Accessors
$msg->lat_lng()/$msg->lat_lng($value)Type:
Message(Google::Type::Latlng::LatLng)The waypoint's geographic coordinates.
$msg->heading()/$msg->heading($value)Type:
Int32The 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.
Google::Cloud::Optimization::V1::FleetRouting::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).
Inherits from Protobuf::Message.
Accessors
$msg->break_requests()/$msg->break_requests($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::BreakRule::BreakRequest)Sequence of breaks. See the `BreakRequest` message.
$msg->frequency_constraints()/$msg->frequency_constraints($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::BreakRule::FrequencyConstraint)Several `FrequencyConstraint` may apply. They must all be satisfied by the `BreakRequest`s of this `BreakRule`. See `FrequencyConstraint`.
Google::Cloud::Optimization::V1::FleetRouting::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 | | | | || || | | | | | | || --++-----------------------------------------------------------------++--> ```
Inherits from Protobuf::Message.
Accessors
$msg->vehicle_index()/$msg->vehicle_index($value)Type:
Int32Vehicle performing the route, identified by its index in the source `ShipmentModel`.
$msg->vehicle_label()/$msg->vehicle_label($value)Type:
StringLabel of the vehicle performing this route, equal to `ShipmentModel.vehicles(vehicle_index).label`, if specified.
$msg->vehicle_start_time()/$msg->vehicle_start_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Time at which the vehicle starts its route.
$msg->vehicle_end_time()/$msg->vehicle_end_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Time at which the vehicle finishes its route.
$msg->visits()/$msg->visits($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::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.
$msg->transitions()/$msg->transitions($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::Transition)Ordered list of transitions for the route.
$msg->has_traffic_infeasibilities()/$msg->has_traffic_infeasibilities($value)Type:
BoolWhen [OptimizeToursRequest.consider_road_traffic][google.cloud.optimization.v1.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,
``` start_time(previous_visit) + duration(previous_visit) + travel_duration(previous_visit, next_visit) > start_time(next_visit) ```
Arrival at next_visit will likely happen later than its current time window due the increased estimate of travel time `travel_duration(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.
$msg->route_polyline()/$msg->route_polyline($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::EncodedPolyline)The encoded polyline representation of the route. This field is only populated if [OptimizeToursRequest.populate_polylines][google.cloud.optimization.v1.OptimizeToursRequest.populate_polylines] is set to true.
$msg->breaks()/$msg->breaks($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::Break)Breaks scheduled for the vehicle performing this route. The `breaks` sequence represents time intervals, each starting at the corresponding `start_time` and lasting `duration` seconds.
$msg->metrics()/$msg->metrics($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::AggregatedMetrics)Duration, distance and load metrics for this route. The fields of [AggregatedMetrics][google.cloud.optimization.v1.AggregatedMetrics] are summed over all [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions] or [ShipmentRoute.visits][google.cloud.optimization.v1.ShipmentRoute.visits], depending on the context.
$msg->route_costs()/$msg->route_costs($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::RouteCostsEntry)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.
$msg->route_total_cost()/$msg->route_total_cost($value)Type:
DoubleTotal cost of the route. The sum of all costs in the cost map.
$msg->end_loads()/$msg->end_loads($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::CapacityQuantity)Deprecated: Use [Transition.vehicle_loads][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads] instead. Vehicle loads upon arrival at its end location, for each type specified in [Vehicle.capacities][google.cloud.optimization.v1.Vehicle.capacities], `start_load_intervals`, `end_load_intervals` or demands. Exception: we omit loads for quantity types unconstrained by intervals and that don't have any non-zero demand on the route.
$msg->travel_steps()/$msg->travel_steps($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::TravelStep)Deprecated: Use [ShipmentRoute.transitions][google.cloud.optimization.v1.ShipmentRoute.transitions] instead. Ordered list of travel steps for the route.
$msg->vehicle_detour()/$msg->vehicle_detour($value)Type:
Message(Google::Protobuf::Duration::Duration)Deprecated: No longer used. This field will only be populated at the [ShipmentRoute.Visit][google.cloud.optimization.v1.ShipmentRoute.Visit] level.
This field is the extra detour time due to the shipments visited on the route.
It is equal to `vehicle_end_time` - `vehicle_start_time` - travel duration from the vehicle's start_location to its `end_location`.
$msg->delay_before_vehicle_end()/$msg->delay_before_vehicle_end($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute::Delay)Deprecated: Delay occurring before the vehicle end. See [TransitionAttributes.delay][google.cloud.optimization.v1.TransitionAttributes.delay].
Google::Cloud::Optimization::V1::FleetRouting::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.
Inherits from Protobuf::Message.
Accessors
$msg->index()/$msg->index($value)Type:
Int32The index corresponds to the index of the shipment in the source `ShipmentModel`.
$msg->label()/$msg->label($value)Type:
StringCopy of the corresponding [Shipment.label][google.cloud.optimization.v1.Shipment.label], if specified in the `Shipment`.
$msg->reasons()/$msg->reasons($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::SkippedShipment::Reason)A list of reasons that explain why the shipment was skipped. See comment above `Reason`.
Google::Cloud::Optimization::V1::FleetRouting::AggregatedMetrics
Aggregated metrics for [ShipmentRoute][google.cloud.optimization.v1.ShipmentRoute] (resp. for [OptimizeToursResponse][google.cloud.optimization.v1.OptimizeToursResponse] over all [Transition][google.cloud.optimization.v1.ShipmentRoute.Transition] and/or [Visit][google.cloud.optimization.v1.ShipmentRoute.Visit] (resp. over all [ShipmentRoute][google.cloud.optimization.v1.ShipmentRoute]) elements.
Inherits from Protobuf::Message.
Accessors
$msg->performed_shipment_count()/$msg->performed_shipment_count($value)Type:
Int32Number of shipments performed. Note that a pickup and delivery pair only counts once.
$msg->travel_duration()/$msg->travel_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)Total travel duration for a route or a solution.
$msg->wait_duration()/$msg->wait_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)Total wait duration for a route or a solution.
$msg->delay_duration()/$msg->delay_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)Total delay duration for a route or a solution.
$msg->break_duration()/$msg->break_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)Total break duration for a route or a solution.
$msg->visit_duration()/$msg->visit_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)Total visit duration for a route or a solution.
$msg->total_duration()/$msg->total_duration($value)Type:
Message(Google::Protobuf::Duration::Duration)The total duration should be equal to the sum of all durations above. For routes, it also corresponds to: [ShipmentRoute.vehicle_end_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_end_time] `-` [ShipmentRoute.vehicle_start_time][google.cloud.optimization.v1.ShipmentRoute.vehicle_start_time]
$msg->travel_distance_meters()/$msg->travel_distance_meters($value)Type:
DoubleTotal travel distance for a route or a solution.
$msg->max_loads()/$msg->max_loads($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::AggregatedMetrics::MaxLoadsEntry)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][google.cloud.optimization.v1.ShipmentRoute.Transition.vehicle_loads] (resp. [ShipmentRoute.metrics.max_loads][google.cloud.optimization.v1.AggregatedMetrics.max_loads].
$msg->costs()/$msg->costs($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::AggregatedMetrics::CostsEntry)Deprecated: Use [ShipmentRoute.route_costs][google.cloud.optimization.v1.ShipmentRoute.route_costs] and [OptimizeToursResponse.Metrics.costs][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.costs] instead.
$msg->total_cost()/$msg->total_cost($value)Type:
DoubleDeprecated: Use [ShipmentRoute.route_total_cost][google.cloud.optimization.v1.ShipmentRoute.route_total_cost] and [OptimizeToursResponse.Metrics.total_cost][google.cloud.optimization.v1.OptimizeToursResponse.Metrics.total_cost] instead.
Google::Cloud::Optimization::V1::FleetRouting::InjectedSolutionConstraint
Solution injected in the request including information about which visits must be constrained and how they must be constrained.
Inherits from Protobuf::Message.
Accessors
$msg->routes()/$msg->routes($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::ShipmentRoute)Routes of the solution to inject. Some routes may be omitted from the original solution. The routes and skipped shipments must satisfy the basic validity assumptions listed for `injected_first_solution_routes`.
$msg->skipped_shipments()/$msg->skipped_shipments($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::SkippedShipment)Skipped shipments of the solution to inject. Some may be omitted from the original solution. See the `routes` field.
$msg->constraint_relaxations()/$msg->constraint_relaxations($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::InjectedSolutionConstraint::ConstraintRelaxation)For zero or more groups of vehicles, specifies when and how much to relax constraints. If this field is empty, all non-empty vehicle routes are fully constrained.
Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursValidationError
Describes an error encountered when validating an `OptimizeToursRequest`.
Inherits from Protobuf::Message.
Accessors
$msg->code()/$msg->code($value)Type:
Int32A validation error is defined by the pair (`code`, `display_name`) 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 `display_name="UNSPECIFIED"` errors, among others. Some may cause the validation process to skip other errors.
*STABILITY*: `code` and `display_name` 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`, `display_name`) 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;
$msg->display_name()/$msg->display_name($value)Type:
StringThe error display name.
$msg->fields()/$msg->fields($value)Type:
Message(Google::Cloud::Optimization::V1::FleetRouting::OptimizeToursValidationError::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 sub_field {name: "pickups" index: 0} } ``` Note, however, that the cardinality of `fields` should not change for a given error code.
$msg->error_message()/$msg->error_message($value)Type:
StringHuman-readable string describing the error. There is a 1:1 mapping between `code` and `error_message` (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 `display_name` and `code` instead.
$msg->offending_values()/$msg->offending_values($value)Type:
StringMay 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.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Optimization::V1::FleetRouting::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.