Class Vehicle.DurationLimit (1.21.0)

public static final class Vehicle.DurationLimit extends GeneratedMessageV3 implements Vehicle.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

Static Fields

COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER

public static final int COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER
Field Value
TypeDescription
int

COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER

public static final int COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER
Field Value
TypeDescription
int

MAX_DURATION_FIELD_NUMBER

public static final int MAX_DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER

public static final int QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

SOFT_MAX_DURATION_FIELD_NUMBER

public static final int SOFT_MAX_DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Vehicle.DurationLimit getDefaultInstance()
Returns
TypeDescription
Vehicle.DurationLimit

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Vehicle.DurationLimit.Builder newBuilder()
Returns
TypeDescription
Vehicle.DurationLimit.Builder

newBuilder(Vehicle.DurationLimit prototype)

public static Vehicle.DurationLimit.Builder newBuilder(Vehicle.DurationLimit prototype)
Parameter
NameDescription
prototypeVehicle.DurationLimit
Returns
TypeDescription
Vehicle.DurationLimit.Builder

parseDelimitedFrom(InputStream input)

public static Vehicle.DurationLimit parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Vehicle.DurationLimit parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Vehicle.DurationLimit parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Vehicle.DurationLimit parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Vehicle.DurationLimit parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Vehicle.DurationLimit parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Vehicle.DurationLimit parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Vehicle.DurationLimit parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Vehicle.DurationLimit parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Vehicle.DurationLimit parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Vehicle.DurationLimit parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Vehicle.DurationLimit parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Vehicle.DurationLimit
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Vehicle.DurationLimit> parser()
Returns
TypeDescription
Parser<DurationLimit>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCostPerHourAfterSoftMax()

public double getCostPerHourAfterSoftMax()

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
TypeDescription
double

The costPerHourAfterSoftMax.

getCostPerSquareHourAfterQuadraticSoftMax()

public double getCostPerSquareHourAfterQuadraticSoftMax()

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
TypeDescription
double

The costPerSquareHourAfterQuadraticSoftMax.

getDefaultInstanceForType()

public Vehicle.DurationLimit getDefaultInstanceForType()
Returns
TypeDescription
Vehicle.DurationLimit

getMaxDuration()

public Duration getMaxDuration()

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

.google.protobuf.Duration max_duration = 1;

Returns
TypeDescription
Duration

The maxDuration.

getMaxDurationOrBuilder()

public DurationOrBuilder getMaxDurationOrBuilder()

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

.google.protobuf.Duration max_duration = 1;

Returns
TypeDescription
DurationOrBuilder

getParserForType()

public Parser<Vehicle.DurationLimit> getParserForType()
Returns
TypeDescription
Parser<DurationLimit>
Overrides

getQuadraticSoftMaxDuration()

public Duration getQuadraticSoftMaxDuration()

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
TypeDescription
Duration

The quadraticSoftMaxDuration.

getQuadraticSoftMaxDurationOrBuilder()

public DurationOrBuilder getQuadraticSoftMaxDurationOrBuilder()

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
TypeDescription
DurationOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getSoftMaxDuration()

public Duration getSoftMaxDuration()

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
TypeDescription
Duration

The softMaxDuration.

getSoftMaxDurationOrBuilder()

public DurationOrBuilder getSoftMaxDurationOrBuilder()

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
TypeDescription
DurationOrBuilder

hasCostPerHourAfterSoftMax()

public boolean hasCostPerHourAfterSoftMax()

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
TypeDescription
boolean

Whether the costPerHourAfterSoftMax field is set.

hasCostPerSquareHourAfterQuadraticSoftMax()

public boolean hasCostPerSquareHourAfterQuadraticSoftMax()

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
TypeDescription
boolean

Whether the costPerSquareHourAfterQuadraticSoftMax field is set.

hasMaxDuration()

public boolean hasMaxDuration()

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

.google.protobuf.Duration max_duration = 1;

Returns
TypeDescription
boolean

Whether the maxDuration field is set.

hasQuadraticSoftMaxDuration()

public boolean hasQuadraticSoftMaxDuration()

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
TypeDescription
boolean

Whether the quadraticSoftMaxDuration field is set.

hasSoftMaxDuration()

public boolean hasSoftMaxDuration()

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
TypeDescription
boolean

Whether the softMaxDuration field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Vehicle.DurationLimit.Builder newBuilderForType()
Returns
TypeDescription
Vehicle.DurationLimit.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Vehicle.DurationLimit.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Vehicle.DurationLimit.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Vehicle.DurationLimit.Builder toBuilder()
Returns
TypeDescription
Vehicle.DurationLimit.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException