Class FleetRoutingClient (2.13.0)

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

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

FleetRoutingClient(FleetRoutingClient const &)

Copy and move support

Parameter
Name Description
FleetRoutingClient const &

FleetRoutingClient(FleetRoutingClient &&)

Copy and move support

Parameter
Name Description
FleetRoutingClient &&

FleetRoutingClient(std::shared_ptr< FleetRoutingConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< FleetRoutingConnection >
opts Options

Operators

operator=(FleetRoutingClient const &)

Copy and move support

Parameter
Name Description
FleetRoutingClient const &
Returns
Type Description
FleetRoutingClient &

operator=(FleetRoutingClient &&)

Copy and move support

Parameter
Name Description
FleetRoutingClient &&
Returns
Type Description
FleetRoutingClient &

Functions

OptimizeTours(google::cloud::optimization::v1::OptimizeToursRequest const &, Options)

Sends an OptimizeToursRequest containing a ShipmentModel and returns an OptimizeToursResponse containing ShipmentRoutes, which are a set of routes to be performed by vehicles minimizing the overall cost.

A ShipmentModel model consists mainly of Shipments that need to be carried out and Vehicles that can be used to transport the Shipments. The ShipmentRoutes assign Shipments to Vehicles. More specifically, they assign a series of Visits 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 ShipmentRoutes to Vehicles that minimizes the total cost where cost has many components defined in the ShipmentModel.

Parameters
Name Description
request google::cloud::optimization::v1::OptimizeToursRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.optimization.v1.OptimizeToursRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::optimization::v1::OptimizeToursResponse >

the result of the RPC. The response message type (google.cloud.optimization.v1.OptimizeToursResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

BatchOptimizeTours(google::cloud::optimization::v1::BatchOptimizeToursRequest const &, Options)

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 ShipmentRoutes, which are a set of routes to be performed by vehicles minimizing the overall cost.

Parameters
Name Description
request google::cloud::optimization::v1::BatchOptimizeToursRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.optimization.v1.BatchOptimizeToursRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::optimization::v1::BatchOptimizeToursResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.optimization.v1.BatchOptimizeToursResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.