[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::Vehicle::LoadLimit (v0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.11.1](/ruby/docs/reference/google-cloud-optimization-v1/0.11.1/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.10.0](/ruby/docs/reference/google-cloud-optimization-v1/0.10.0/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.9.2](/ruby/docs/reference/google-cloud-optimization-v1/0.9.2/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.8.2](/ruby/docs/reference/google-cloud-optimization-v1/0.8.2/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.7.0](/ruby/docs/reference/google-cloud-optimization-v1/0.7.0/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.6.0](/ruby/docs/reference/google-cloud-optimization-v1/0.6.0/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.5.0](/ruby/docs/reference/google-cloud-optimization-v1/0.5.0/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.4.1](/ruby/docs/reference/google-cloud-optimization-v1/0.4.1/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.3.0](/ruby/docs/reference/google-cloud-optimization-v1/0.3.0/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.2.1](/ruby/docs/reference/google-cloud-optimization-v1/0.2.1/Google-Cloud-Optimization-V1-Vehicle-LoadLimit)\n- [0.1.1](/ruby/docs/reference/google-cloud-optimization-v1/0.1.1/Google-Cloud-Optimization-V1-Vehicle-LoadLimit) \nReference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::Vehicle::LoadLimit.\n\nDefines a load limit applying to a vehicle, e.g. \"this truck may only\ncarry up to 3500 kg\". See\n[load_limits](/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)\"). \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #cost_per_unit_above_soft_max\n\n def cost_per_unit_above_soft_max() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- If the load ever exceeds\n [soft_max_load](/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)\")\n along this vehicle's route, the following cost penalty applies (only once\n per vehicle): (load -\n [soft_max_load](/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)\"))\n\n - [cost_per_unit_above_soft_max](/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](/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)\").\n\n### #cost_per_unit_above_soft_max=\n\n def cost_per_unit_above_soft_max=(value) -\u003e ::Float\n\n**Parameter**\n\n- **value** (::Float) ---\n\n If the load ever exceeds\n [soft_max_load](/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)\")\n along this vehicle's route, the following cost penalty applies (only once\n per vehicle): (load -\n [soft_max_load](/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)\"))\n- [cost_per_unit_above_soft_max](/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](/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)\"). \n**Returns**\n\n- (::Float) --- If the load ever exceeds\n [soft_max_load](/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)\")\n along this vehicle's route, the following cost penalty applies (only once\n per vehicle): (load -\n [soft_max_load](/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)\"))\n\n - [cost_per_unit_above_soft_max](/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](/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)\").\n\n### #end_load_interval\n\n def end_load_interval() -\u003e ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval\n\n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](./Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the end of the route.\n\n### #end_load_interval=\n\n def end_load_interval=(value) -\u003e ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](./Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the end of the route. \n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](./Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the end of the route.\n\n### #max_load\n\n def max_load() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- The maximum acceptable amount of load.\n\n### #max_load=\n\n def max_load=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- The maximum acceptable amount of load. \n**Returns**\n\n- (::Integer) --- The maximum acceptable amount of load.\n\n### #soft_max_load\n\n def soft_max_load() -\u003e ::Integer\n\n**Returns**\n\n- (::Integer) --- A soft limit of the load. See [cost_per_unit_above_soft_max](/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)\").\n\n### #soft_max_load=\n\n def soft_max_load=(value) -\u003e ::Integer\n\n**Parameter**\n\n- **value** (::Integer) --- A soft limit of the load. See [cost_per_unit_above_soft_max](/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)\"). \n**Returns**\n\n- (::Integer) --- A soft limit of the load. See [cost_per_unit_above_soft_max](/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)\").\n\n### #start_load_interval\n\n def start_load_interval() -\u003e ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval\n\n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](./Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the start of the route.\n\n### #start_load_interval=\n\n def start_load_interval=(value) -\u003e ::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](./Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the start of the route. \n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::Vehicle::LoadLimit::Interval](./Google-Cloud-Optimization-V1-Vehicle-LoadLimit-Interval)) --- The acceptable load interval of the vehicle at the start of the route."]]