Class OptimizeToursRequest.Builder (1.76.0)

publicstaticfinalclass OptimizeToursRequest.BuilderextendsGeneratedMessageV3.Builder<OptimizeToursRequest.Builder>implementsOptimizeToursRequestOrBuilder

Request to be given to a tour optimization solver which defines the shipment model to solve as well as optimization parameters.

Protobuf type google.cloud.optimization.v1.OptimizeToursRequest

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllInjectedFirstSolutionRoutes(Iterable<? extends ShipmentRoute> values)

publicOptimizeToursRequest.BuilderaddAllInjectedFirstSolutionRoutes(Iterable<?extendsShipmentRoute>values)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
values Iterable<? extends com.google.cloud.optimization.v1.ShipmentRoute>
Returns
Type Description
OptimizeToursRequest.Builder

addAllRefreshDetailsRoutes(Iterable<? extends ShipmentRoute> values)

publicOptimizeToursRequest.BuilderaddAllRefreshDetailsRoutes(Iterable<?extendsShipmentRoute>values)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
values Iterable<? extends com.google.cloud.optimization.v1.ShipmentRoute>
Returns
Type Description
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(ShipmentRoute value)

publicOptimizeToursRequest.BuilderaddInjectedFirstSolutionRoutes(ShipmentRoutevalue)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
value ShipmentRoute
Returns
Type Description
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(ShipmentRoute.Builder builderForValue)

publicOptimizeToursRequest.BuilderaddInjectedFirstSolutionRoutes(ShipmentRoute.BuilderbuilderForValue)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
builderForValue ShipmentRoute.Builder
Returns
Type Description
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(int index, ShipmentRoute value)

publicOptimizeToursRequest.BuilderaddInjectedFirstSolutionRoutes(intindex,ShipmentRoutevalue)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
Name Description
index int
value ShipmentRoute
Returns
Type Description
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutes(int index, ShipmentRoute.Builder builderForValue)

publicOptimizeToursRequest.BuilderaddInjectedFirstSolutionRoutes(intindex,ShipmentRoute.BuilderbuilderForValue)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
Name Description
index int
builderForValue ShipmentRoute.Builder
Returns
Type Description
OptimizeToursRequest.Builder

addInjectedFirstSolutionRoutesBuilder()

publicShipmentRoute.BuilderaddInjectedFirstSolutionRoutesBuilder()

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
Type Description
ShipmentRoute.Builder

addInjectedFirstSolutionRoutesBuilder(int index)

publicShipmentRoute.BuilderaddInjectedFirstSolutionRoutesBuilder(intindex)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRoute.Builder

addRefreshDetailsRoutes(ShipmentRoute value)

publicOptimizeToursRequest.BuilderaddRefreshDetailsRoutes(ShipmentRoutevalue)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
value ShipmentRoute
Returns
Type Description
OptimizeToursRequest.Builder

addRefreshDetailsRoutes(ShipmentRoute.Builder builderForValue)

publicOptimizeToursRequest.BuilderaddRefreshDetailsRoutes(ShipmentRoute.BuilderbuilderForValue)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
builderForValue ShipmentRoute.Builder
Returns
Type Description
OptimizeToursRequest.Builder

addRefreshDetailsRoutes(int index, ShipmentRoute value)

publicOptimizeToursRequest.BuilderaddRefreshDetailsRoutes(intindex,ShipmentRoutevalue)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
Name Description
index int
value ShipmentRoute
Returns
Type Description
OptimizeToursRequest.Builder

addRefreshDetailsRoutes(int index, ShipmentRoute.Builder builderForValue)

publicOptimizeToursRequest.BuilderaddRefreshDetailsRoutes(intindex,ShipmentRoute.BuilderbuilderForValue)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
Name Description
index int
builderForValue ShipmentRoute.Builder
Returns
Type Description
OptimizeToursRequest.Builder

addRefreshDetailsRoutesBuilder()

publicShipmentRoute.BuilderaddRefreshDetailsRoutesBuilder()

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
Type Description
ShipmentRoute.Builder

addRefreshDetailsRoutesBuilder(int index)

publicShipmentRoute.BuilderaddRefreshDetailsRoutesBuilder(intindex)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRoute.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicOptimizeToursRequest.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

build()

publicOptimizeToursRequestbuild()
Returns
Type Description
OptimizeToursRequest

buildPartial()

publicOptimizeToursRequestbuildPartial()
Returns
Type Description
OptimizeToursRequest

clear()

publicOptimizeToursRequest.Builderclear()
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

clearAllowLargeDeadlineDespiteInterruptionRisk()

publicOptimizeToursRequest.BuilderclearAllowLargeDeadlineDespiteInterruptionRisk()

If 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.

bool allow_large_deadline_despite_interruption_risk = 14;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearConsiderRoadTraffic()

publicOptimizeToursRequest.BuilderclearConsiderRoadTraffic()

Consider traffic estimation in calculating ShipmentRoute fields Transition.travel_duration, Visit.start_time, and vehicle_end_time; in setting the ShipmentRoute.has_traffic_infeasibilities field, and in calculating the OptimizeToursResponse.total_cost field.

bool consider_road_traffic = 11;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicOptimizeToursRequest.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

clearGeodesicMetersPerSecond()

publicOptimizeToursRequest.BuilderclearGeodesicMetersPerSecond()

When 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.

optional double geodesic_meters_per_second = 16;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearInjectedFirstSolutionRoutes()

publicOptimizeToursRequest.BuilderclearInjectedFirstSolutionRoutes()

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
Type Description
OptimizeToursRequest.Builder

clearInjectedSolutionConstraint()

publicOptimizeToursRequest.BuilderclearInjectedSolutionConstraint()

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
Type Description
OptimizeToursRequest.Builder

clearInterpretInjectedSolutionsUsingLabels()

publicOptimizeToursRequest.BuilderclearInterpretInjectedSolutionsUsingLabels()

If true:

  • uses 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 to new ShipmentRoute.vehicle_index to update ConstraintRelaxation.vehicle_indices if non-empty, but the mapping must be unambiguous (i.e., multiple ShipmentRoutes must not share the same original vehicle_index).
  • uses ShipmentRoute.Visit.shipment_label instead of shipment_index to match visits in an injected solution with shipments in the request;
  • uses SkippedShipment.label instead of 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 in the request;

  • Shipment.label in the request;
  • ShipmentRoute.vehicle_label in the injected solution;
  • SkippedShipment.label and 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 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 (resp. 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.

bool interpret_injected_solutions_using_labels = 10;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearLabel()

publicOptimizeToursRequest.BuilderclearLabel()

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearMaxValidationErrors()

publicOptimizeToursRequest.BuilderclearMaxValidationErrors()

Truncates 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 field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearModel()

publicOptimizeToursRequest.BuilderclearModel()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
Type Description
OptimizeToursRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

publicOptimizeToursRequest.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

clearParent()

publicOptimizeToursRequest.BuilderclearParent()

Required. 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.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearPopulatePolylines()

publicOptimizeToursRequest.BuilderclearPopulatePolylines()

If true, polylines will be populated in response ShipmentRoutes.

bool populate_polylines = 12;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearPopulateTransitionPolylines()

publicOptimizeToursRequest.BuilderclearPopulateTransitionPolylines()

If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_transition_polylines = 13;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearPopulateTravelStepPolylines() (deprecated)

publicOptimizeToursRequest.BuilderclearPopulateTravelStepPolylines()

Deprecated. google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=359

Deprecated: Use OptimizeToursRequest.populate_transition_polylines instead. If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_travel_step_polylines = 20 [deprecated = true];

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearRefreshDetailsRoutes()

publicOptimizeToursRequest.BuilderclearRefreshDetailsRoutes()

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
Type Description
OptimizeToursRequest.Builder

clearSearchMode()

publicOptimizeToursRequest.BuilderclearSearchMode()

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearSolvingMode()

publicOptimizeToursRequest.BuilderclearSolvingMode()

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clearTimeout()

publicOptimizeToursRequest.BuilderclearTimeout()

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.

.google.protobuf.Duration timeout = 2;

Returns
Type Description
OptimizeToursRequest.Builder

clearUseGeodesicDistances()

publicOptimizeToursRequest.BuilderclearUseGeodesicDistances()

If 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.

bool use_geodesic_distances = 15;

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

clone()

publicOptimizeToursRequest.Builderclone()
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

getAllowLargeDeadlineDespiteInterruptionRisk()

publicbooleangetAllowLargeDeadlineDespiteInterruptionRisk()

If 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.

bool allow_large_deadline_despite_interruption_risk = 14;

Returns
Type Description
boolean

The allowLargeDeadlineDespiteInterruptionRisk.

getConsiderRoadTraffic()

publicbooleangetConsiderRoadTraffic()

Consider traffic estimation in calculating ShipmentRoute fields Transition.travel_duration, Visit.start_time, and vehicle_end_time; in setting the ShipmentRoute.has_traffic_infeasibilities field, and in calculating the OptimizeToursResponse.total_cost field.

bool consider_road_traffic = 11;

Returns
Type Description
boolean

The considerRoadTraffic.

getDefaultInstanceForType()

publicOptimizeToursRequestgetDefaultInstanceForType()
Returns
Type Description
OptimizeToursRequest

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getGeodesicMetersPerSecond()

publicdoublegetGeodesicMetersPerSecond()

When 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.

optional double geodesic_meters_per_second = 16;

Returns
Type Description
double

The geodesicMetersPerSecond.

getInjectedFirstSolutionRoutes(int index)

publicShipmentRoutegetInjectedFirstSolutionRoutes(intindex)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRoute

getInjectedFirstSolutionRoutesBuilder(int index)

publicShipmentRoute.BuildergetInjectedFirstSolutionRoutesBuilder(intindex)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRoute.Builder

getInjectedFirstSolutionRoutesBuilderList()

publicList<ShipmentRoute.Builder>getInjectedFirstSolutionRoutesBuilderList()

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
Type Description
List<Builder>

getInjectedFirstSolutionRoutesCount()

publicintgetInjectedFirstSolutionRoutesCount()

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
Type Description
int

getInjectedFirstSolutionRoutesList()

publicList<ShipmentRoute>getInjectedFirstSolutionRoutesList()

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
Type Description
List<ShipmentRoute>

getInjectedFirstSolutionRoutesOrBuilder(int index)

publicShipmentRouteOrBuildergetInjectedFirstSolutionRoutesOrBuilder(intindex)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRouteOrBuilder

getInjectedFirstSolutionRoutesOrBuilderList()

publicList<?extendsShipmentRouteOrBuilder>getInjectedFirstSolutionRoutesOrBuilderList()

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Returns
Type Description
List<? extends com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>

getInjectedSolutionConstraint()

publicInjectedSolutionConstraintgetInjectedSolutionConstraint()

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
Type Description
InjectedSolutionConstraint

The injectedSolutionConstraint.

getInjectedSolutionConstraintBuilder()

publicInjectedSolutionConstraint.BuildergetInjectedSolutionConstraintBuilder()

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
Type Description
InjectedSolutionConstraint.Builder

getInjectedSolutionConstraintOrBuilder()

publicInjectedSolutionConstraintOrBuildergetInjectedSolutionConstraintOrBuilder()

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
Type Description
InjectedSolutionConstraintOrBuilder

getInterpretInjectedSolutionsUsingLabels()

publicbooleangetInterpretInjectedSolutionsUsingLabels()

If true:

  • uses 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 to new ShipmentRoute.vehicle_index to update ConstraintRelaxation.vehicle_indices if non-empty, but the mapping must be unambiguous (i.e., multiple ShipmentRoutes must not share the same original vehicle_index).
  • uses ShipmentRoute.Visit.shipment_label instead of shipment_index to match visits in an injected solution with shipments in the request;
  • uses SkippedShipment.label instead of 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 in the request;

  • Shipment.label in the request;
  • ShipmentRoute.vehicle_label in the injected solution;
  • SkippedShipment.label and 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 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 (resp. 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.

bool interpret_injected_solutions_using_labels = 10;

Returns
Type Description
boolean

The interpretInjectedSolutionsUsingLabels.

getLabel()

publicStringgetLabel()

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Returns
Type Description
String

The label.

getLabelBytes()

publicByteStringgetLabelBytes()

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Returns
Type Description
ByteString

The bytes for label.

getMaxValidationErrors()

publicintgetMaxValidationErrors()

Truncates 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 field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Returns
Type Description
int

The maxValidationErrors.

getModel()

publicShipmentModelgetModel()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
Type Description
ShipmentModel

The model.

getModelBuilder()

publicShipmentModel.BuildergetModelBuilder()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
Type Description
ShipmentModel.Builder

getModelOrBuilder()

publicShipmentModelOrBuildergetModelOrBuilder()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
Type Description
ShipmentModelOrBuilder

getParent()

publicStringgetParent()

Required. 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.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The parent.

getParentBytes()

publicByteStringgetParentBytes()

Required. 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.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for parent.

getPopulatePolylines()

publicbooleangetPopulatePolylines()

If true, polylines will be populated in response ShipmentRoutes.

bool populate_polylines = 12;

Returns
Type Description
boolean

The populatePolylines.

getPopulateTransitionPolylines()

publicbooleangetPopulateTransitionPolylines()

If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_transition_polylines = 13;

Returns
Type Description
boolean

The populateTransitionPolylines.

getPopulateTravelStepPolylines() (deprecated)

publicbooleangetPopulateTravelStepPolylines()

Deprecated. google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=359

Deprecated: Use OptimizeToursRequest.populate_transition_polylines instead. If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_travel_step_polylines = 20 [deprecated = true];

Returns
Type Description
boolean

The populateTravelStepPolylines.

getRefreshDetailsRoutes(int index)

publicShipmentRoutegetRefreshDetailsRoutes(intindex)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRoute

getRefreshDetailsRoutesBuilder(int index)

publicShipmentRoute.BuildergetRefreshDetailsRoutesBuilder(intindex)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRoute.Builder

getRefreshDetailsRoutesBuilderList()

publicList<ShipmentRoute.Builder>getRefreshDetailsRoutesBuilderList()

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
Type Description
List<Builder>

getRefreshDetailsRoutesCount()

publicintgetRefreshDetailsRoutesCount()

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
Type Description
int

getRefreshDetailsRoutesList()

publicList<ShipmentRoute>getRefreshDetailsRoutesList()

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
Type Description
List<ShipmentRoute>

getRefreshDetailsRoutesOrBuilder(int index)

publicShipmentRouteOrBuildergetRefreshDetailsRoutesOrBuilder(intindex)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
index int
Returns
Type Description
ShipmentRouteOrBuilder

getRefreshDetailsRoutesOrBuilderList()

publicList<?extendsShipmentRouteOrBuilder>getRefreshDetailsRoutesOrBuilderList()

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Returns
Type Description
List<? extends com.google.cloud.optimization.v1.ShipmentRouteOrBuilder>

getSearchMode()

publicOptimizeToursRequest.SearchModegetSearchMode()

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Returns
Type Description
OptimizeToursRequest.SearchMode

The searchMode.

getSearchModeValue()

publicintgetSearchModeValue()

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Returns
Type Description
int

The enum numeric value on the wire for searchMode.

getSolvingMode()

publicOptimizeToursRequest.SolvingModegetSolvingMode()

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Returns
Type Description
OptimizeToursRequest.SolvingMode

The solvingMode.

getSolvingModeValue()

publicintgetSolvingModeValue()

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Returns
Type Description
int

The enum numeric value on the wire for solvingMode.

getTimeout()

publicDurationgetTimeout()

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.

.google.protobuf.Duration timeout = 2;

Returns
Type Description
Duration

The timeout.

getTimeoutBuilder()

publicDuration.BuildergetTimeoutBuilder()

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.

.google.protobuf.Duration timeout = 2;

Returns
Type Description
Builder

getTimeoutOrBuilder()

publicDurationOrBuildergetTimeoutOrBuilder()

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.

.google.protobuf.Duration timeout = 2;

Returns
Type Description
DurationOrBuilder

getUseGeodesicDistances()

publicbooleangetUseGeodesicDistances()

If 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.

bool use_geodesic_distances = 15;

Returns
Type Description
boolean

The useGeodesicDistances.

hasGeodesicMetersPerSecond()

publicbooleanhasGeodesicMetersPerSecond()

When 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.

optional double geodesic_meters_per_second = 16;

Returns
Type Description
boolean

Whether the geodesicMetersPerSecond field is set.

hasInjectedSolutionConstraint()

publicbooleanhasInjectedSolutionConstraint()

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Returns
Type Description
boolean

Whether the injectedSolutionConstraint field is set.

hasMaxValidationErrors()

publicbooleanhasMaxValidationErrors()

Truncates 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 field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Returns
Type Description
boolean

Whether the maxValidationErrors field is set.

hasModel()

publicbooleanhasModel()

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Returns
Type Description
boolean

Whether the model field is set.

hasTimeout()

publicbooleanhasTimeout()

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.

.google.protobuf.Duration timeout = 2;

Returns
Type Description
boolean

Whether the timeout field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(OptimizeToursRequest other)

publicOptimizeToursRequest.BuildermergeFrom(OptimizeToursRequestother)
Parameter
Name Description
other OptimizeToursRequest
Returns
Type Description
OptimizeToursRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicOptimizeToursRequest.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
OptimizeToursRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicOptimizeToursRequest.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

mergeInjectedSolutionConstraint(InjectedSolutionConstraint value)

publicOptimizeToursRequest.BuildermergeInjectedSolutionConstraint(InjectedSolutionConstraintvalue)

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Parameter
Name Description
value InjectedSolutionConstraint
Returns
Type Description
OptimizeToursRequest.Builder

mergeModel(ShipmentModel value)

publicOptimizeToursRequest.BuildermergeModel(ShipmentModelvalue)

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Parameter
Name Description
value ShipmentModel
Returns
Type Description
OptimizeToursRequest.Builder

mergeTimeout(Duration value)

publicOptimizeToursRequest.BuildermergeTimeout(Durationvalue)

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.

.google.protobuf.Duration timeout = 2;

Parameter
Name Description
value Duration
Returns
Type Description
OptimizeToursRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalOptimizeToursRequest.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

removeInjectedFirstSolutionRoutes(int index)

publicOptimizeToursRequest.BuilderremoveInjectedFirstSolutionRoutes(intindex)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameter
Name Description
index int
Returns
Type Description
OptimizeToursRequest.Builder

removeRefreshDetailsRoutes(int index)

publicOptimizeToursRequest.BuilderremoveRefreshDetailsRoutes(intindex)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameter
Name Description
index int
Returns
Type Description
OptimizeToursRequest.Builder

setAllowLargeDeadlineDespiteInterruptionRisk(boolean value)

publicOptimizeToursRequest.BuildersetAllowLargeDeadlineDespiteInterruptionRisk(booleanvalue)

If 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.

bool allow_large_deadline_despite_interruption_risk = 14;

Parameter
Name Description
value boolean

The allowLargeDeadlineDespiteInterruptionRisk to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setConsiderRoadTraffic(boolean value)

publicOptimizeToursRequest.BuildersetConsiderRoadTraffic(booleanvalue)

Consider traffic estimation in calculating ShipmentRoute fields Transition.travel_duration, Visit.start_time, and vehicle_end_time; in setting the ShipmentRoute.has_traffic_infeasibilities field, and in calculating the OptimizeToursResponse.total_cost field.

bool consider_road_traffic = 11;

Parameter
Name Description
value boolean

The considerRoadTraffic to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicOptimizeToursRequest.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

setGeodesicMetersPerSecond(double value)

publicOptimizeToursRequest.BuildersetGeodesicMetersPerSecond(doublevalue)

When 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.

optional double geodesic_meters_per_second = 16;

Parameter
Name Description
value double

The geodesicMetersPerSecond to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setInjectedFirstSolutionRoutes(int index, ShipmentRoute value)

publicOptimizeToursRequest.BuildersetInjectedFirstSolutionRoutes(intindex,ShipmentRoutevalue)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
Name Description
index int
value ShipmentRoute
Returns
Type Description
OptimizeToursRequest.Builder

setInjectedFirstSolutionRoutes(int index, ShipmentRoute.Builder builderForValue)

publicOptimizeToursRequest.BuildersetInjectedFirstSolutionRoutes(intindex,ShipmentRoute.BuilderbuilderForValue)

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 is empty or its vehicle_index is included in 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.

repeated .google.cloud.optimization.v1.ShipmentRoute injected_first_solution_routes = 7;

Parameters
Name Description
index int
builderForValue ShipmentRoute.Builder
Returns
Type Description
OptimizeToursRequest.Builder

setInjectedSolutionConstraint(InjectedSolutionConstraint value)

publicOptimizeToursRequest.BuildersetInjectedSolutionConstraint(InjectedSolutionConstraintvalue)

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Parameter
Name Description
value InjectedSolutionConstraint
Returns
Type Description
OptimizeToursRequest.Builder

setInjectedSolutionConstraint(InjectedSolutionConstraint.Builder builderForValue)

publicOptimizeToursRequest.BuildersetInjectedSolutionConstraint(InjectedSolutionConstraint.BuilderbuilderForValue)

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.

.google.cloud.optimization.v1.InjectedSolutionConstraint injected_solution_constraint = 8;

Parameter
Name Description
builderForValue InjectedSolutionConstraint.Builder
Returns
Type Description
OptimizeToursRequest.Builder

setInterpretInjectedSolutionsUsingLabels(boolean value)

publicOptimizeToursRequest.BuildersetInterpretInjectedSolutionsUsingLabels(booleanvalue)

If true:

  • uses 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 to new ShipmentRoute.vehicle_index to update ConstraintRelaxation.vehicle_indices if non-empty, but the mapping must be unambiguous (i.e., multiple ShipmentRoutes must not share the same original vehicle_index).
  • uses ShipmentRoute.Visit.shipment_label instead of shipment_index to match visits in an injected solution with shipments in the request;
  • uses SkippedShipment.label instead of 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 in the request;

  • Shipment.label in the request;
  • ShipmentRoute.vehicle_label in the injected solution;
  • SkippedShipment.label and 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 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 (resp. 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.

bool interpret_injected_solutions_using_labels = 10;

Parameter
Name Description
value boolean

The interpretInjectedSolutionsUsingLabels to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setLabel(String value)

publicOptimizeToursRequest.BuildersetLabel(Stringvalue)

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Parameter
Name Description
value String

The label to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setLabelBytes(ByteString value)

publicOptimizeToursRequest.BuildersetLabelBytes(ByteStringvalue)

Label that may be used to identify this request, reported back in the OptimizeToursResponse.request_label.

string label = 17;

Parameter
Name Description
value ByteString

The bytes for label to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setMaxValidationErrors(int value)

publicOptimizeToursRequest.BuildersetMaxValidationErrors(intvalue)

Truncates 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 field. This defaults to 100 and is capped at 10,000.

optional int32 max_validation_errors = 5;

Parameter
Name Description
value int

The maxValidationErrors to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setModel(ShipmentModel value)

publicOptimizeToursRequest.BuildersetModel(ShipmentModelvalue)

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Parameter
Name Description
value ShipmentModel
Returns
Type Description
OptimizeToursRequest.Builder

setModel(ShipmentModel.Builder builderForValue)

publicOptimizeToursRequest.BuildersetModel(ShipmentModel.BuilderbuilderForValue)

Shipment model to solve.

.google.cloud.optimization.v1.ShipmentModel model = 3;

Parameter
Name Description
builderForValue ShipmentModel.Builder
Returns
Type Description
OptimizeToursRequest.Builder

setParent(String value)

publicOptimizeToursRequest.BuildersetParent(Stringvalue)

Required. 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.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The parent to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setParentBytes(ByteString value)

publicOptimizeToursRequest.BuildersetParentBytes(ByteStringvalue)

Required. 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.

string parent = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for parent to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setPopulatePolylines(boolean value)

publicOptimizeToursRequest.BuildersetPopulatePolylines(booleanvalue)

If true, polylines will be populated in response ShipmentRoutes.

bool populate_polylines = 12;

Parameter
Name Description
value boolean

The populatePolylines to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setPopulateTransitionPolylines(boolean value)

publicOptimizeToursRequest.BuildersetPopulateTransitionPolylines(booleanvalue)

If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_transition_polylines = 13;

Parameter
Name Description
value boolean

The populateTransitionPolylines to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setPopulateTravelStepPolylines(boolean value) (deprecated)

publicOptimizeToursRequest.BuildersetPopulateTravelStepPolylines(booleanvalue)

Deprecated. google.cloud.optimization.v1.OptimizeToursRequest.populate_travel_step_polylines is deprecated. See google/cloud/optimization/v1/fleet_routing.proto;l=359

Deprecated: Use OptimizeToursRequest.populate_transition_polylines instead. If true, polylines will be populated in response ShipmentRoute.transitions. Note that in this case, the polylines will also be populated in the deprecated travel_steps.

bool populate_travel_step_polylines = 20 [deprecated = true];

Parameter
Name Description
value boolean

The populateTravelStepPolylines to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setRefreshDetailsRoutes(int index, ShipmentRoute value)

publicOptimizeToursRequest.BuildersetRefreshDetailsRoutes(intindex,ShipmentRoutevalue)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
Name Description
index int
value ShipmentRoute
Returns
Type Description
OptimizeToursRequest.Builder

setRefreshDetailsRoutes(int index, ShipmentRoute.Builder builderForValue)

publicOptimizeToursRequest.BuildersetRefreshDetailsRoutes(intindex,ShipmentRoute.BuilderbuilderForValue)

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.

repeated .google.cloud.optimization.v1.ShipmentRoute refresh_details_routes = 9;

Parameters
Name Description
index int
builderForValue ShipmentRoute.Builder
Returns
Type Description
OptimizeToursRequest.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicOptimizeToursRequest.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

setSearchMode(OptimizeToursRequest.SearchMode value)

publicOptimizeToursRequest.BuildersetSearchMode(OptimizeToursRequest.SearchModevalue)

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Parameter
Name Description
value OptimizeToursRequest.SearchMode

The searchMode to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setSearchModeValue(int value)

publicOptimizeToursRequest.BuildersetSearchModeValue(intvalue)

Search mode used to solve the request.

.google.cloud.optimization.v1.OptimizeToursRequest.SearchMode search_mode = 6;

Parameter
Name Description
value int

The enum numeric value on the wire for searchMode to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setSolvingMode(OptimizeToursRequest.SolvingMode value)

publicOptimizeToursRequest.BuildersetSolvingMode(OptimizeToursRequest.SolvingModevalue)

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Parameter
Name Description
value OptimizeToursRequest.SolvingMode

The solvingMode to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setSolvingModeValue(int value)

publicOptimizeToursRequest.BuildersetSolvingModeValue(intvalue)

By default, the solving mode is DEFAULT_SOLVE (0).

.google.cloud.optimization.v1.OptimizeToursRequest.SolvingMode solving_mode = 4;

Parameter
Name Description
value int

The enum numeric value on the wire for solvingMode to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

setTimeout(Duration value)

publicOptimizeToursRequest.BuildersetTimeout(Durationvalue)

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.

.google.protobuf.Duration timeout = 2;

Parameter
Name Description
value Duration
Returns
Type Description
OptimizeToursRequest.Builder

setTimeout(Duration.Builder builderForValue)

publicOptimizeToursRequest.BuildersetTimeout(Duration.BuilderbuilderForValue)

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.

.google.protobuf.Duration timeout = 2;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
OptimizeToursRequest.Builder

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalOptimizeToursRequest.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
OptimizeToursRequest.Builder
Overrides

setUseGeodesicDistances(boolean value)

publicOptimizeToursRequest.BuildersetUseGeodesicDistances(booleanvalue)

If 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.

bool use_geodesic_distances = 15;

Parameter
Name Description
value boolean

The useGeodesicDistances to set.

Returns
Type Description
OptimizeToursRequest.Builder

This builder for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.