public sealed class Vehicle.Types.LoadLimit : IMessage<Vehicle.Types.LoadLimit>, IEquatable<Vehicle.Types.LoadLimit>, IDeepCloneable<Vehicle.Types.LoadLimit>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Optimization v1 API class Vehicle.Types.LoadLimit.
Defines a load limit applying to a vehicle, e.g. "this truck may only
carry up to 3500 kg". See
[load_limits][google.cloud.optimization.v1.Vehicle.load_limits].
public double CostPerUnitAboveSoftMax { get; set; }
If the load ever exceeds
[soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load]
along this vehicle's route, the following cost penalty applies (only once
per vehicle): (load -
[soft_max_load][google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load])
[cost_per_unit_above_soft_max][google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max]. All costs
add up and must be in the same unit as
[Shipment.penalty_cost][google.cloud.optimization.v1.Shipment.penalty_cost].
[[["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-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eVehicle.Types.LoadLimit\u003c/code\u003e class defines load restrictions for vehicles in the Cloud Optimization v1 API, such as weight or capacity limits.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows setting a maximum load (\u003ccode\u003eMaxLoad\u003c/code\u003e), a soft limit (\u003ccode\u003eSoftMaxLoad\u003c/code\u003e), and a cost penalty (\u003ccode\u003eCostPerUnitAboveSoftMax\u003c/code\u003e) for exceeding the soft limit.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVehicle.Types.LoadLimit\u003c/code\u003e also specifies acceptable load intervals at the start (\u003ccode\u003eStartLoadInterval\u003c/code\u003e) and end (\u003ccode\u003eEndLoadInterval\u003c/code\u003e) of a vehicle's route.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eVehicle.Types.LoadLimit\u003c/code\u003e is 2.6.0, and the documentation also includes versions dating back to 1.0.0-beta01.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eVehicle.Types.LoadLimit\u003c/code\u003e class inherits from \u003ccode\u003eobject\u003c/code\u003e and implements \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e interfaces.\u003c/p\u003e\n"]]],[],null,["# Cloud Optimization v1 API - Class Vehicle.Types.LoadLimit (2.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.5.0/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.4.0/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.3.0/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.2.0/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.1.0/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.0.0/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit)\n- [1.0.0-beta01](/dotnet/docs/reference/Google.Cloud.Optimization.V1/1.0.0-beta01/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit) \n\n public sealed class Vehicle.Types.LoadLimit : IMessage\u003cVehicle.Types.LoadLimit\u003e, IEquatable\u003cVehicle.Types.LoadLimit\u003e, IDeepCloneable\u003cVehicle.Types.LoadLimit\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Optimization v1 API class Vehicle.Types.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\\]\\[google.cloud.optimization.v1.Vehicle.load_limits\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Vehicle.Types.LoadLimit \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Vehicle](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle)[Types](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types)[LoadLimit](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Vehicle](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle)[Types](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types)[LoadLimit](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Vehicle](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle)[Types](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types)[LoadLimit](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.Vehicle.Types.LoadLimit), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Optimization.V1](/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Optimization.V1.dll\n\nConstructors\n------------\n\n### LoadLimit()\n\n public LoadLimit()\n\n### LoadLimit(LoadLimit)\n\n public LoadLimit(Vehicle.Types.LoadLimit other)\n\nProperties\n----------\n\n### CostPerUnitAboveSoftMax\n\n public double CostPerUnitAboveSoftMax { get; set; }\n\nIf the load ever exceeds\n\\[soft_max_load\\]\\[google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load\\]\nalong this vehicle's route, the following cost penalty applies (only once\nper vehicle): (load -\n\\[soft_max_load\\]\\[google.cloud.optimization.v1.Vehicle.LoadLimit.soft_max_load\\])\n\n- \\[cost_per_unit_above_soft_max\\]\\[google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max\\]. All costs add up and must be in the same unit as \\[Shipment.penalty_cost\\]\\[google.cloud.optimization.v1.Shipment.penalty_cost\\].\n\n### EndLoadInterval\n\n public Vehicle.Types.LoadLimit.Types.Interval EndLoadInterval { get; set; }\n\nThe acceptable load interval of the vehicle at the end of the route.\n\n### HasMaxLoad\n\n public bool HasMaxLoad { get; }\n\nGets whether the \"max_load\" field is set\n\n### MaxLoad\n\n public long MaxLoad { get; set; }\n\nThe maximum acceptable amount of load.\n\n### SoftMaxLoad\n\n public long SoftMaxLoad { get; set; }\n\nA soft limit of the load. See\n\\[cost_per_unit_above_soft_max\\]\\[google.cloud.optimization.v1.Vehicle.LoadLimit.cost_per_unit_above_soft_max\\].\n\n### StartLoadInterval\n\n public Vehicle.Types.LoadLimit.Types.Interval StartLoadInterval { get; set; }\n\nThe acceptable load interval of the vehicle at the start of the route."]]