# Google Maps Route Optimization V1 Client - Class LoadLimit (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 LoadLimit.

Defines a load limit applying to a vehicle, e.g. "this truck may only
carry up to 3500 kg". See
[load_limits](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getLoadLimits__).

Generated from protobuf message `google.maps.routeoptimization.v1.Vehicle.LoadLimit`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1 \\ Vehicle

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ max_load` | `int|string` The maximum acceptable amount of load. |
| `↳ soft_max_load` | `int|string` A soft limit of the load. See [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getCostPerUnitAboveSoftMax__). |
| `↳ cost_per_unit_above_soft_max` | `float` If the load ever exceeds [soft_max_load](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__) along this vehicle's route, the following cost penalty applies (only once per vehicle): (load - [soft_max_load](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__)) \* \* [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getCostPerUnitAboveSoftMax__). All costs add up and must be in the same unit as [Shipment.penalty_cost](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment#_Google_Maps_RouteOptimization_V1_Shipment__getPenaltyCost__). Soft limits may only be defined on types that apply to either pickups only or deliveries only throughout the model. |
| `↳ start_load_interval` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.Interval` The acceptable load interval of the vehicle at the start of the route. |
| `↳ end_load_interval` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.Interval` The acceptable load interval of the vehicle at the end of the route. |
| `↳ cost_per_kilometer` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.LoadCost` Cost of moving one unit of load over one kilometer for this vehicle. This can be used as a proxy for fuel consumption: if the load is a weight (in Newtons), then load\*kilometer has the dimension of an energy. Experimental: See <https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request> for more details. |
| `↳ cost_per_traveled_hour` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.LoadCost` Cost of traveling with a unit of load during one hour for this vehicle. Experimental: See <https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request> for more details. |

### getMaxLoad

The maximum acceptable amount of load.

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

### hasMaxLoad

### clearMaxLoad

### setMaxLoad

The maximum acceptable amount of load.

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

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

### getSoftMaxLoad

A soft limit of the load. See
[cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getCostPerUnitAboveSoftMax__).

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

### setSoftMaxLoad

A soft limit of the load. See
[cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getCostPerUnitAboveSoftMax__).

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

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

### getCostPerUnitAboveSoftMax

If the load ever exceeds
[soft_max_load](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__)
along this vehicle's route, the following cost penalty applies (only once
per vehicle): (load -
[soft_max_load](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__))

- [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getCostPerUnitAboveSoftMax__). All costs add up and must be in the same unit as [Shipment.penalty_cost](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment#_Google_Maps_RouteOptimization_V1_Shipment__getPenaltyCost__).

Soft limits may only be defined on types that apply to either pickups
only or deliveries only throughout the model.

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

### setCostPerUnitAboveSoftMax

If the load ever exceeds
[soft_max_load](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__)
along this vehicle's route, the following cost penalty applies (only once
per vehicle): (load -
[soft_max_load](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__))

- [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit#_Google_Maps_RouteOptimization_V1_Vehicle_LoadLimit__getCostPerUnitAboveSoftMax__). All costs add up and must be in the same unit as [Shipment.penalty_cost](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment#_Google_Maps_RouteOptimization_V1_Shipment__getPenaltyCost__).

Soft limits may only be defined on types that apply to either pickups
only or deliveries only throughout the model.

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

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

### getStartLoadInterval

The acceptable load interval of the vehicle at the start of the route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.Interval|null` |   |

### hasStartLoadInterval

### clearStartLoadInterval

### setStartLoadInterval

The acceptable load interval of the vehicle at the start of the route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.Interval` |

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

### getEndLoadInterval

The acceptable load interval of the vehicle at the end of the route.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.Interval|null` |   |

### hasEndLoadInterval

### clearEndLoadInterval

### setEndLoadInterval

The acceptable load interval of the vehicle at the end of the route.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.Interval` |

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

### getCostPerKilometer

Cost of moving one unit of load over one kilometer for this vehicle.

This can be used as a proxy for fuel consumption: if the load is a weight
(in Newtons), then load\*kilometer has the dimension of an energy.
Experimental: See
<https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request>
for more details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.LoadCost|null` |   |

### hasCostPerKilometer

### clearCostPerKilometer

### setCostPerKilometer

Cost of moving one unit of load over one kilometer for this vehicle.

This can be used as a proxy for fuel consumption: if the load is a weight
(in Newtons), then load\*kilometer has the dimension of an energy.
Experimental: See
<https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request>
for more details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.LoadCost` |

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

### getCostPerTraveledHour

Cost of traveling with a unit of load during one hour for this vehicle.

Experimental: See
<https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request>
for more details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.LoadCost|null` |   |

### hasCostPerTraveledHour

### clearCostPerTraveledHour

### setCostPerTraveledHour

Cost of traveling with a unit of load during one hour for this vehicle.

Experimental: See
<https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request>
for more details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle.LoadLimit.LoadCost` |

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