# Google Maps Route Optimization V1 Client - Class VehicleFullness (0.6.2)

0.6.2 (latest) 0.6.1 0.5.1 0.4.1 0.3.3 0.2.0 0.1.0 Reference documentation and code samples for the Google Maps Route Optimization V1 Client class VehicleFullness.

[VehicleFullness](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.VehicleFullness) is a
metric which computes how full a vehicle is. Each
[VehicleFullness](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.VehicleFullness) field is
between 0 and 1, computed as the ratio between a capped metric field (e.g.

[AggregatedMetrics.travel_distance_meters](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.AggregatedMetrics#_Google_Maps_RouteOptimization_V1_AggregatedMetrics__getTravelDistanceMeters__))
and its related vehicle limit (e.g.
[Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__)),
if it exists. Otherwise the fullness ratio stays unset. If the limit is 0,
the field is set to 1. Note: when a route is subject to traffic
infeasibilities, some raw fullness ratios might exceed 1.0, e.g. the vehicle
might exceed its distance limit. In these cases, we cap the fullness values
at 1.0.

Generated from protobuf message `google.maps.routeoptimization.v1.VehicleFullness`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ max_fullness` | `float` Maximum of all other fields in this message. |
| `↳ distance` | `float` The ratio between [AggregatedMetrics.travel_distance_meters](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.AggregatedMetrics#_Google_Maps_RouteOptimization_V1_AggregatedMetrics__getTravelDistanceMeters__) and [Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__). If [Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__) is unset, this field will be unset. |
| `↳ travel_duration` | `float` The ratio between AggregatedMetrics.travel_duration_seconds and [Vehicle.travel_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getTravelDurationLimit__). If [Vehicle.travel_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getTravelDurationLimit__) is unset, this field will be unset. |
| `↳ active_duration` | `float` The ratio between AggregatedMetrics.total_duration_seconds and [Vehicle.route_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDurationLimit__). If [Vehicle.route_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDurationLimit__) is unset, this field will be unset. |
| `↳ max_load` | `float` The maximum ratio among all types of AggregatedMetrics.max_load and their respective [Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__). If all [Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__) fields are unset, this field will be unset. |
| `↳ active_span` | `float` The ratio (vehicle_end_time - vehicle_start_time) / (latest_vehicle_end_time - earliest_vehicle_start_time) for a given vehicle. If the denominator is not present, it uses ([ShipmentModel.global_end_time](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getGlobalEndTime__) - [ShipmentModel.global_start_time](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getGlobalStartTime__)) instead. |

### getMaxFullness

Maximum of all other fields in this message.

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

### hasMaxFullness

### clearMaxFullness

### setMaxFullness

Maximum of all other fields in this message.

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

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

### getDistance

The ratio between
[AggregatedMetrics.travel_distance_meters](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.AggregatedMetrics#_Google_Maps_RouteOptimization_V1_AggregatedMetrics__getTravelDistanceMeters__)
and
[Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__).

If
[Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__)
is unset, this field will be unset.

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

### hasDistance

### clearDistance

### setDistance

The ratio between
[AggregatedMetrics.travel_distance_meters](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.AggregatedMetrics#_Google_Maps_RouteOptimization_V1_AggregatedMetrics__getTravelDistanceMeters__)
and
[Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__).

If
[Vehicle.route_distance_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDistanceLimit__)
is unset, this field will be unset.

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

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

### getTravelDuration

The ratio between AggregatedMetrics.travel_duration_seconds and
[Vehicle.travel_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getTravelDurationLimit__).

If
[Vehicle.travel_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getTravelDurationLimit__)
is unset, this field will be unset.

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

### hasTravelDuration

### clearTravelDuration

### setTravelDuration

The ratio between AggregatedMetrics.travel_duration_seconds and
[Vehicle.travel_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getTravelDurationLimit__).

If
[Vehicle.travel_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getTravelDurationLimit__)
is unset, this field will be unset.

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

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

### getActiveDuration

The ratio between AggregatedMetrics.total_duration_seconds and
[Vehicle.route_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDurationLimit__).

If
[Vehicle.route_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDurationLimit__)
is unset, this field will be unset.

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

### hasActiveDuration

### clearActiveDuration

### setActiveDuration

The ratio between AggregatedMetrics.total_duration_seconds and
[Vehicle.route_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDurationLimit__).

If
[Vehicle.route_duration_limit](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getRouteDurationLimit__)
is unset, this field will be unset.

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

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

### getMaxLoad

The maximum ratio among all types of AggregatedMetrics.max_load and
their respective
[Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__).

If all
[Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__)
fields are unset, this field will be unset.

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

### hasMaxLoad

### clearMaxLoad

### setMaxLoad

The maximum ratio among all types of AggregatedMetrics.max_load and
their respective
[Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__).

If all
[Vehicle.load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__)
fields are unset, this field will be unset.

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

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

### getActiveSpan

The ratio (vehicle_end_time - vehicle_start_time) /
(latest_vehicle_end_time - earliest_vehicle_start_time) for a given
vehicle. If the denominator is not present, it uses
([ShipmentModel.global_end_time](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getGlobalEndTime__)
-
[ShipmentModel.global_start_time](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getGlobalStartTime__))
instead.

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

### hasActiveSpan

### clearActiveSpan

### setActiveSpan

The ratio (vehicle_end_time - vehicle_start_time) /
(latest_vehicle_end_time - earliest_vehicle_start_time) for a given
vehicle. If the denominator is not present, it uses
([ShipmentModel.global_end_time](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getGlobalEndTime__)
-
[ShipmentModel.global_start_time](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.ShipmentModel#_Google_Maps_RouteOptimization_V1_ShipmentModel__getGlobalStartTime__))
instead.

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

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