# Google Cloud Optimization V1 Client - Class AggregatedMetrics (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 AggregatedMetrics.

Aggregated metrics for
[ShipmentRoute](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute) (resp. for
[OptimizeToursResponse](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse)
over all [Transition](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute.Transition)
and/or [Visit](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute.Visit) (resp. over
all [ShipmentRoute](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute)) elements.

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

## Namespace

Google \\ Cloud \\ Optimization \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ performed_shipment_count` | `int` Number of shipments performed. Note that a pickup and delivery pair only counts once. |
| `↳ travel_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Total travel duration for a route or a solution. |
| `↳ wait_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Total wait duration for a route or a solution. |
| `↳ delay_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Total delay duration for a route or a solution. |
| `↳ break_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Total break duration for a route or a solution. |
| `↳ visit_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Total visit duration for a route or a solution. |
| `↳ total_duration` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` The total duration should be equal to the sum of all durations above. For routes, it also corresponds to: [ShipmentRoute.vehicle_end_time](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getVehicleEndTime__) `-` [ShipmentRoute.vehicle_start_time](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getVehicleStartTime__) |
| `↳ travel_distance_meters` | `float` Total travel distance for a route or a solution. |
| `↳ max_loads` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Maximum load achieved over the entire route (resp. solution), for each of the quantities on this route (resp. solution), computed as the maximum over all [Transition.vehicle_loads](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute.Transition#_Google_Cloud_Optimization_V1_ShipmentRoute_Transition__getVehicleLoads__) (resp. [ShipmentRoute.metrics.max_loads](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.AggregatedMetrics#_Google_Cloud_Optimization_V1_AggregatedMetrics__getMaxLoads__). |
| `↳ costs` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Deprecated: Use [ShipmentRoute.route_costs](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getRouteCosts__) and [OptimizeToursResponse.Metrics.costs](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics#_Google_Cloud_Optimization_V1_OptimizeToursResponse_Metrics__getCosts__) instead. |
| `↳ total_cost` | `float` Deprecated: Use [ShipmentRoute.route_total_cost](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getRouteTotalCost__) and [OptimizeToursResponse.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. |

### getPerformedShipmentCount

Number of shipments performed. Note that a pickup and delivery pair only
counts once.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setPerformedShipmentCount

Number of shipments performed. Note that a pickup and delivery pair only
counts once.

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

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

### getTravelDuration

Total travel duration for a route or a solution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasTravelDuration

### clearTravelDuration

### setTravelDuration

Total travel duration for a route or a solution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getWaitDuration

Total wait duration for a route or a solution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasWaitDuration

### clearWaitDuration

### setWaitDuration

Total wait duration for a route or a solution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getDelayDuration

Total delay duration for a route or a solution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasDelayDuration

### clearDelayDuration

### setDelayDuration

Total delay duration for a route or a solution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getBreakDuration

Total break duration for a route or a solution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasBreakDuration

### clearBreakDuration

### setBreakDuration

Total break duration for a route or a solution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getVisitDuration

Total visit duration for a route or a solution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasVisitDuration

### clearVisitDuration

### setVisitDuration

Total visit duration for a route or a solution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getTotalDuration

The total duration should be equal to the sum of all durations above.

For routes, it also corresponds to:
[ShipmentRoute.vehicle_end_time](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getVehicleEndTime__)
`-`
[ShipmentRoute.vehicle_start_time](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getVehicleStartTime__)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasTotalDuration

### clearTotalDuration

### setTotalDuration

The total duration should be equal to the sum of all durations above.

For routes, it also corresponds to:
[ShipmentRoute.vehicle_end_time](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getVehicleEndTime__)
`-`
[ShipmentRoute.vehicle_start_time](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getVehicleStartTime__)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

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

### getTravelDistanceMeters

Total travel distance for a route or a solution.

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

### setTravelDistanceMeters

Total travel distance for a route or a solution.

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

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

### getMaxLoads

Maximum load achieved over the entire route (resp. solution), for each of
the quantities on this route (resp. solution), computed as the maximum over
all
[Transition.vehicle_loads](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute.Transition#_Google_Cloud_Optimization_V1_ShipmentRoute_Transition__getVehicleLoads__)
(resp.

[ShipmentRoute.metrics.max_loads](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.AggregatedMetrics#_Google_Cloud_Optimization_V1_AggregatedMetrics__getMaxLoads__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setMaxLoads

Maximum load achieved over the entire route (resp. solution), for each of
the quantities on this route (resp. solution), computed as the maximum over
all
[Transition.vehicle_loads](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute.Transition#_Google_Cloud_Optimization_V1_ShipmentRoute_Transition__getVehicleLoads__)
(resp.

[ShipmentRoute.metrics.max_loads](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.AggregatedMetrics#_Google_Cloud_Optimization_V1_AggregatedMetrics__getMaxLoads__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getCosts

Deprecated: Use
[ShipmentRoute.route_costs](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getRouteCosts__)
and
[OptimizeToursResponse.Metrics.costs](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics#_Google_Cloud_Optimization_V1_OptimizeToursResponse_Metrics__getCosts__)
instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setCosts

Deprecated: Use
[ShipmentRoute.route_costs](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getRouteCosts__)
and
[OptimizeToursResponse.Metrics.costs](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.OptimizeToursResponse.Metrics#_Google_Cloud_Optimization_V1_OptimizeToursResponse_Metrics__getCosts__)
instead.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getTotalCost

Deprecated: Use
[ShipmentRoute.route_total_cost](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getRouteTotalCost__)
and
[OptimizeToursResponse.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.

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

### setTotalCost

Deprecated: Use
[ShipmentRoute.route_total_cost](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.ShipmentRoute#_Google_Cloud_Optimization_V1_ShipmentRoute__getRouteTotalCost__)
and
[OptimizeToursResponse.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.

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

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