# Class FleetRoutingGrpc.FleetRoutingFutureStub (1.91.0)

1.91.0 (latest) 1.89.0 1.86.0 1.85.0 1.83.0 1.81.0 1.80.0 1.78.0 1.76.0 1.74.0 1.73.0 1.72.0 1.71.0 1.70.0 1.68.0 1.66.0 1.65.0 1.62.0 1.61.0 1.60.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.10.0 1.9.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.14 0.1.2

    public static final class FleetRoutingGrpc.FleetRoutingFutureStub extends AbstractFutureStub<FleetRoutingGrpc.FleetRoutingFutureStub>

A stub to allow clients to do ListenableFuture-style rpc calls to service FleetRouting.

A service for optimizing vehicle tours.
Validity of certain types of fields:

- `google.protobuf.Timestamp`
  - Times are in Unix time: seconds since 1970-01-01T00:00:00+00:00.
  - seconds must be in \[0, 253402300799\], i.e. in \[1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00\].
  - nanos must be unset or set to 0.
- `google.protobuf.Duration`
  - seconds must be in \[0, 253402300799\], i.e. in \[1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00\].
  - nanos must be unset or set to 0.
- `google.type.LatLng`
  - latitude must be in \[-90.0, 90.0\].
  - longitude must be in \[-180.0, 180.0\].
  - at least one of latitude and longitude must be non-zero.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> io.grpc.stub.AbstractStub \> io.grpc.stub.AbstractFutureStub \> FleetRoutingGrpc.FleetRoutingFutureStub

## Inherited Members

io.grpc.stub.AbstractFutureStub.\<T\>newStub(io.grpc.stub.AbstractStub.StubFactory\<T\>,io.grpc.Channel) io.grpc.stub.AbstractFutureStub.\<T\>newStub(io.grpc.stub.AbstractStub.StubFactory\<T\>,io.grpc.Channel,io.grpc.CallOptions) io.grpc.stub.AbstractStub.\<T\>withOption(io.grpc.CallOptions.Key\<T\>,T) io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions) io.grpc.stub.AbstractStub.getCallOptions() io.grpc.stub.AbstractStub.getChannel() io.grpc.stub.AbstractStub.withCallCredentials(io.grpc.CallCredentials) io.grpc.stub.AbstractStub.withChannel(io.grpc.Channel) io.grpc.stub.AbstractStub.withCompression(java.lang.String) io.grpc.stub.AbstractStub.withDeadline(io.grpc.Deadline) io.grpc.stub.AbstractStub.withDeadlineAfter(java.time.Duration) io.grpc.stub.AbstractStub.withDeadlineAfter(long,java.util.concurrent.TimeUnit) io.grpc.stub.AbstractStub.withExecutor(java.util.concurrent.Executor) io.grpc.stub.AbstractStub.withInterceptors(io.grpc.ClientInterceptor...) io.grpc.stub.AbstractStub.withMaxInboundMessageSize(int) io.grpc.stub.AbstractStub.withMaxOutboundMessageSize(int) io.grpc.stub.AbstractStub.withOnReadyThreshold(int) io.grpc.stub.AbstractStub.withWaitForReady() [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Methods

### batchOptimizeTours(BatchOptimizeToursRequest request)

    public ListenableFuture<Operation> batchOptimizeTours(BatchOptimizeToursRequest request)

Optimizes vehicle tours for one or more `OptimizeToursRequest`
messages as a batch.
This method is a Long Running Operation (LRO). The inputs for optimization
(`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
messages) are read/written from/to Cloud Storage in user-specified
format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
contains a `ShipmentModel` and returns an `OptimizeToursResponse`
containing `ShipmentRoute`s, which are a set of routes to be performed by
vehicles minimizing the overall cost.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.BatchOptimizeToursRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.common.util.concurrent.ListenableFuture<https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### build(Channel channel, CallOptions callOptions)

    protected FleetRoutingGrpc.FleetRoutingFutureStub build(Channel channel, CallOptions callOptions)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `channel` | `io.grpc.Channel` |
| `callOptions` | `io.grpc.CallOptions` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.FleetRoutingGrpc.FleetRoutingFutureStub` |   |

**Overrides** io.grpc.stub.AbstractStub.build(io.grpc.Channel,io.grpc.CallOptions)

### optimizeTours(OptimizeToursRequest request)

    public ListenableFuture<OptimizeToursResponse> optimizeTours(OptimizeToursRequest request)

Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
`OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
routes to be performed by vehicles minimizing the overall cost.
A `ShipmentModel` model consists mainly of `Shipment`s that need to be
carried out and `Vehicle`s that can be used to transport the `Shipment`s.
The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
they assign a series of `Visit`s to each vehicle, where a `Visit`
corresponds to a `VisitRequest`, which is a pickup or delivery for a
`Shipment`.
The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
minimizes the total cost where cost has many components defined in the
`ShipmentModel`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.OptimizeToursRequest` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.common.util.concurrent.ListenableFuture<https://docs.cloud.google.com/java/docs/reference/google-cloud-optimization/latest/com.google.cloud.optimization.v1.OptimizeToursResponse>` |   |