# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::Vehicle::LoadLimit (v0.16.0)

0.16.0 (latest) 0.15.0 0.14.1 0.13.0 0.12.0 0.11.1 0.10.0 0.9.2 0.8.2 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 0.2.1 0.1.1 Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::Vehicle::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/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle#Google__Cloud__Optimization__V1__Vehicle_load_limits_instance_ "Google::Cloud::Optimization::V1::Vehicle#load_limits (method)").

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #cost_per_unit_above_soft_max

    def cost_per_unit_above_soft_max() -> ::Float

**Returns**

- (::Float) --- If the load ever exceeds
  [soft_max_load](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_soft_max_load_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load (method)")
  along this vehicle's route, the following cost penalty applies (only once
  per vehicle): (load -
  [soft_max_load](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_soft_max_load_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load (method)"))

  - [cost_per_unit_above_soft_max](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_cost_per_unit_above_soft_max_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max (method)"). All costs add up and must be in the same unit as [Shipment.penalty_cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment#Google__Cloud__Optimization__V1__Shipment_penalty_cost_instance_ "Google::Cloud::Optimization::V1::Shipment#penalty_cost (method)").

### #cost_per_unit_above_soft_max=

    def cost_per_unit_above_soft_max=(value) -> ::Float

**Parameter**

- **value** (::Float) ---

  If the load ever exceeds
  [soft_max_load](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_soft_max_load_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load (method)")
  along this vehicle's route, the following cost penalty applies (only once
  per vehicle): (load -
  [soft_max_load](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_soft_max_load_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load (method)"))
  - [cost_per_unit_above_soft_max](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_cost_per_unit_above_soft_max_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max (method)"). All costs add up and must be in the same unit as [Shipment.penalty_cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment#Google__Cloud__Optimization__V1__Shipment_penalty_cost_instance_ "Google::Cloud::Optimization::V1::Shipment#penalty_cost (method)").
**Returns**

- (::Float) --- If the load ever exceeds
  [soft_max_load](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_soft_max_load_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load (method)")
  along this vehicle's route, the following cost penalty applies (only once
  per vehicle): (load -
  [soft_max_load](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_soft_max_load_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#soft_max_load (method)"))

  - [cost_per_unit_above_soft_max](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_cost_per_unit_above_soft_max_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max (method)"). All costs add up and must be in the same unit as [Shipment.penalty_cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Shipment#Google__Cloud__Optimization__V1__Shipment_penalty_cost_instance_ "Google::Cloud::Optimization::V1::Shipment#penalty_cost (method)").

### #end_load_interval

    def end_load_interval() -> ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval

**Returns**

- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the end of the route.

### #end_load_interval=

    def end_load_interval=(value) -> ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval

**Parameter**

- **value** ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the end of the route.
**Returns**

- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the end of the route.

### #max_load

    def max_load() -> ::Integer

**Returns**

- (::Integer) --- The maximum acceptable amount of load.

### #max_load=

    def max_load=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- The maximum acceptable amount of load.
**Returns**

- (::Integer) --- The maximum acceptable amount of load.

### #soft_max_load

    def soft_max_load() -> ::Integer

**Returns**

- (::Integer) --- A soft limit of the load. See [cost_per_unit_above_soft_max](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_cost_per_unit_above_soft_max_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max (method)").

### #soft_max_load=

    def soft_max_load=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- A soft limit of the load. See [cost_per_unit_above_soft_max](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_cost_per_unit_above_soft_max_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max (method)").
**Returns**

- (::Integer) --- A soft limit of the load. See [cost_per_unit_above_soft_max](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit#Google__Cloud__Optimization__V1__Vehicle__LoadLimit_cost_per_unit_above_soft_max_instance_ "Google::Cloud::Optimization::V1::Vehicle::LoadLimit#cost_per_unit_above_soft_max (method)").

### #start_load_interval

    def start_load_interval() -> ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval

**Returns**

- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the start of the route.

### #start_load_interval=

    def start_load_interval=(value) -> ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval

**Parameter**

- **value** ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the start of the route.
**Returns**

- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the start of the route.