# Google Cloud Optimization V1 Client - Class OptimizeToursResponse (1.1.3)

1.1.3 (latest) 1.1.2 1.0.5 0.7.0 0.6.5 0.5.1 0.4.0 0.3.4 0.2.0 0.1.9 Reference documentation and code samples for the Google Cloud Optimization V1 Client class OptimizeToursResponse.

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

Generated from protobuf message `google.cloud.optimization.v1.OptimizeToursResponse`

## Namespace

Google \\ Cloud \\ Optimization \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ routes` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute>` Routes computed for each vehicle; the i-th route corresponds to the i-th vehicle in the model. |
| `↳ request_label` | `string` Copy of the [OptimizeToursRequest.label](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursRequest#_Google_Cloud_Optimization_V1_OptimizeToursRequest__getLabel__), if a label was specified in the request. |
| `↳ skipped_shipments` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.SkippedShipment>` The list of all shipments skipped. |
| `↳ validation_errors` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursValidationError>` List of all the validation errors that we were able to detect independently. See the "MULTIPLE ERRORS" explanation for the [OptimizeToursValidationError](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursValidationError) message. |
| `↳ metrics` | `https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics` Duration, distance and usage metrics for this solution. |
| `↳ total_cost` | `float` Deprecated: Use [Metrics.total_cost](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics#_Google_Cloud_Optimization_V1_OptimizeToursResponse_Metrics__getTotalCost__) instead. Total cost of the solution. This takes into account all costs: costs per per hour and travel hour, fixed vehicle costs, unperformed shipment penalty costs, global duration cost, etc. |

### getRoutes

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute>` |   |

### setRoutes

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRequestLabel

Copy of the
[OptimizeToursRequest.label](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursRequest#_Google_Cloud_Optimization_V1_OptimizeToursRequest__getLabel__),
if a label was specified in the request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setRequestLabel

Copy of the
[OptimizeToursRequest.label](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursRequest#_Google_Cloud_Optimization_V1_OptimizeToursRequest__getLabel__),
if a label was specified in the request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSkippedShipments

The list of all shipments skipped.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.SkippedShipment>` |   |

### setSkippedShipments

The list of all shipments skipped.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.SkippedShipment>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getValidationErrors

List of all the validation errors that we were able to detect
independently. See the "MULTIPLE ERRORS" explanation for the
[OptimizeToursValidationError](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursValidationError)
message.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursValidationError>` |   |

### setValidationErrors

List of all the validation errors that we were able to detect
independently. See the "MULTIPLE ERRORS" explanation for the
[OptimizeToursValidationError](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursValidationError)
message.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursValidationError>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMetrics

Duration, distance and usage metrics for this solution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics|null` |   |

### hasMetrics

### clearMetrics

### setMetrics

Duration, distance and usage metrics for this solution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTotalCost

Deprecated: Use
[Metrics.total_cost](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics#_Google_Cloud_Optimization_V1_OptimizeToursResponse_Metrics__getTotalCost__)
instead. Total cost of the solution. This takes into account all costs:
costs per per hour and travel hour, fixed vehicle costs, unperformed
shipment penalty costs, global duration cost, etc.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setTotalCost

Deprecated: Use
[Metrics.total_cost](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics#_Google_Cloud_Optimization_V1_OptimizeToursResponse_Metrics__getTotalCost__)
instead. Total cost of the solution. This takes into account all costs:
costs per per hour and travel hour, fixed vehicle costs, unperformed
shipment penalty costs, global duration cost, etc.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |