Class Vehicle.DurationLimit (1.61.0)

publicstaticfinalclass Vehicle.DurationLimitextendsGeneratedMessageV3implementsVehicle.DurationLimitOrBuilder

A limit defining a maximum duration of the route of a vehicle. It can be either hard or soft.

When a soft limit field is defined, both the soft max threshold and its associated cost must be defined together.

Protobuf type google.cloud.optimization.v1.Vehicle.DurationLimit

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER

publicstaticfinalintCOST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER
Field Value
Type Description
int

COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER

publicstaticfinalintCOST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER
Field Value
Type Description
int

MAX_DURATION_FIELD_NUMBER

publicstaticfinalintMAX_DURATION_FIELD_NUMBER
Field Value
Type Description
int

QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER

publicstaticfinalintQUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER
Field Value
Type Description
int

SOFT_MAX_DURATION_FIELD_NUMBER

publicstaticfinalintSOFT_MAX_DURATION_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticVehicle.DurationLimitgetDefaultInstance()
Returns
Type Description
Vehicle.DurationLimit

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticVehicle.DurationLimit.BuildernewBuilder()
Returns
Type Description
Vehicle.DurationLimit.Builder

newBuilder(Vehicle.DurationLimit prototype)

publicstaticVehicle.DurationLimit.BuildernewBuilder(Vehicle.DurationLimitprototype)
Parameter
Name Description
prototype Vehicle.DurationLimit
Returns
Type Description
Vehicle.DurationLimit.Builder

parseDelimitedFrom(InputStream input)

publicstaticVehicle.DurationLimitparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticVehicle.DurationLimitparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticVehicle.DurationLimitparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticVehicle.DurationLimitparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticVehicle.DurationLimitparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticVehicle.DurationLimitparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticVehicle.DurationLimitparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticVehicle.DurationLimitparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticVehicle.DurationLimitparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticVehicle.DurationLimitparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticVehicle.DurationLimitparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticVehicle.DurationLimitparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Vehicle.DurationLimit
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Vehicle.DurationLimit>parser()
Returns
Type Description
Parser<DurationLimit>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCostPerHourAfterSoftMax()

publicdoublegetCostPerHourAfterSoftMax()

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_hour_after_soft_max * (duration - soft_max_duration) </code></code> The cost must be nonnegative.

optional double cost_per_hour_after_soft_max = 3;

Returns
Type Description
double

The costPerHourAfterSoftMax.

getCostPerSquareHourAfterQuadraticSoftMax()

publicdoublegetCostPerSquareHourAfterQuadraticSoftMax()

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated.

The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows:

<code><code> cost_per_square_hour_after_quadratic_soft_max * (duration - quadratic_soft_max_duration)^2 </code></code>

The cost must be nonnegative.

optional double cost_per_square_hour_after_quadratic_soft_max = 5;

Returns
Type Description
double

The costPerSquareHourAfterQuadraticSoftMax.

getDefaultInstanceForType()

publicVehicle.DurationLimitgetDefaultInstanceForType()
Returns
Type Description
Vehicle.DurationLimit

getMaxDuration()

publicDurationgetMaxDuration()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description
Duration

The maxDuration.

getMaxDurationOrBuilder()

publicDurationOrBuildergetMaxDurationOrBuilder()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description
DurationOrBuilder

getParserForType()

publicParser<Vehicle.DurationLimit>getParserForType()
Returns
Type Description
Parser<DurationLimit>
Overrides

getQuadraticSoftMaxDuration()

publicDurationgetQuadraticSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit.

If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day:

<code>max_duration - quadratic_soft_max_duration &lt;= 86400 seconds</code>

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description
Duration

The quadraticSoftMaxDuration.

getQuadraticSoftMaxDurationOrBuilder()

publicDurationOrBuildergetQuadraticSoftMaxDurationOrBuilder()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit.

If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day:

<code>max_duration - quadratic_soft_max_duration &lt;= 86400 seconds</code>

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description
DurationOrBuilder

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getSoftMaxDuration()

publicDurationgetSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit.

If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description
Duration

The softMaxDuration.

getSoftMaxDurationOrBuilder()

publicDurationOrBuildergetSoftMaxDurationOrBuilder()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit.

If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description
DurationOrBuilder

hasCostPerHourAfterSoftMax()

publicbooleanhasCostPerHourAfterSoftMax()

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: <code><code> cost_per_hour_after_soft_max * (duration - soft_max_duration) </code></code> The cost must be nonnegative.

optional double cost_per_hour_after_soft_max = 3;

Returns
Type Description
boolean

Whether the costPerHourAfterSoftMax field is set.

hasCostPerSquareHourAfterQuadraticSoftMax()

publicbooleanhasCostPerSquareHourAfterQuadraticSoftMax()

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated.

The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows:

<code><code> cost_per_square_hour_after_quadratic_soft_max * (duration - quadratic_soft_max_duration)^2 </code></code>

The cost must be nonnegative.

optional double cost_per_square_hour_after_quadratic_soft_max = 5;

Returns
Type Description
boolean

Whether the costPerSquareHourAfterQuadraticSoftMax field is set.

hasMaxDuration()

publicbooleanhasMaxDuration()

A hard limit constraining the duration to be at most max_duration.

.google.protobuf.Duration max_duration = 1;

Returns
Type Description
boolean

Whether the maxDuration field is set.

hasQuadraticSoftMaxDuration()

publicbooleanhasQuadraticSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit.

If defined, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration, and the difference must be no larger than one day:

<code>max_duration - quadratic_soft_max_duration &lt;= 86400 seconds</code>

.google.protobuf.Duration quadratic_soft_max_duration = 4;

Returns
Type Description
boolean

Whether the quadraticSoftMaxDuration field is set.

hasSoftMaxDuration()

publicbooleanhasSoftMaxDuration()

A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit.

If defined, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

.google.protobuf.Duration soft_max_duration = 2;

Returns
Type Description
boolean

Whether the softMaxDuration field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicVehicle.DurationLimit.BuildernewBuilderForType()
Returns
Type Description
Vehicle.DurationLimit.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedVehicle.DurationLimit.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Vehicle.DurationLimit.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicVehicle.DurationLimit.BuildertoBuilder()
Returns
Type Description
Vehicle.DurationLimit.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.