# Google Cloud Optimization V1 Client - Class LoadLimit (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 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/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getLoadLimits__).

Generated from protobuf message `google.cloud.optimization.v1.Vehicle.LoadLimit`

## Namespace

Google \\ Cloud \\ Optimization \\ 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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__)) \* \* [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Shipment#_Google_Cloud_Optimization_V1_Shipment__getPenaltyCost__). |
| `↳ start_load_interval` | `https://docs.cloud.google.com/php/docs/reference/cloud-optimization/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/cloud-optimization/latest/V1.Vehicle.LoadLimit.Interval` The acceptable load interval of the vehicle at the end of the route. |

### 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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__))

- [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Shipment#_Google_Cloud_Optimization_V1_Shipment__getPenaltyCost__).

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

### setCostPerUnitAboveSoftMax

If the load ever exceeds
[soft_max_load](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_V1_Vehicle_LoadLimit__getSoftMaxLoad__))

- [cost_per_unit_above_soft_max](https://docs.cloud.google.com/php/docs/reference/cloud-optimization/latest/V1.Vehicle.LoadLimit#_Google_Cloud_Optimization_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/cloud-optimization/latest/V1.Shipment#_Google_Cloud_Optimization_V1_Shipment__getPenaltyCost__).

| **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/cloud-optimization/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/cloud-optimization/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/cloud-optimization/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/cloud-optimization/latest/V1.Vehicle.LoadLimit.Interval` |

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