Interface DistanceLimitOrBuilder (1.76.0)

publicinterface DistanceLimitOrBuilderextendsMessageOrBuilder

Implements

MessageOrBuilder

Methods

getCostPerKilometerAboveSoftMax()

publicabstractdoublegetCostPerKilometerAboveSoftMax()

Cost per kilometer incurred if distance is above soft_max_meters limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: <code><code> (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. </code></code> The cost must be nonnegative.

optional double cost_per_kilometer_above_soft_max = 3;

Returns
Type Description
double

The costPerKilometerAboveSoftMax.

getCostPerKilometerBelowSoftMax()

publicabstractdoublegetCostPerKilometerBelowSoftMax()

Cost per kilometer incurred, increasing up to soft_max_meters, with formula: <code><code> min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. </code></code><code> This cost is not supported in </code>route_distance_limit.

optional double cost_per_kilometer_below_soft_max = 4;

Returns
Type Description
double

The costPerKilometerBelowSoftMax.

getMaxMeters()

publicabstractlonggetMaxMeters()

A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.

optional int64 max_meters = 1;

Returns
Type Description
long

The maxMeters.

getSoftMaxMeters()

publicabstractlonggetSoftMaxMeters()

A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.

If defined soft_max_meters must be less than max_meters and must be nonnegative.

optional int64 soft_max_meters = 2;

Returns
Type Description
long

The softMaxMeters.

hasCostPerKilometerAboveSoftMax()

publicabstractbooleanhasCostPerKilometerAboveSoftMax()

Cost per kilometer incurred if distance is above soft_max_meters limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following: <code><code> (distance_meters - soft_max_meters) / 1000.0 * cost_per_kilometer_above_soft_max. </code></code> The cost must be nonnegative.

optional double cost_per_kilometer_above_soft_max = 3;

Returns
Type Description
boolean

Whether the costPerKilometerAboveSoftMax field is set.

hasCostPerKilometerBelowSoftMax()

publicabstractbooleanhasCostPerKilometerBelowSoftMax()

Cost per kilometer incurred, increasing up to soft_max_meters, with formula: <code><code> min(distance_meters, soft_max_meters) / 1000.0 * cost_per_kilometer_below_soft_max. </code></code><code> This cost is not supported in </code>route_distance_limit.

optional double cost_per_kilometer_below_soft_max = 4;

Returns
Type Description
boolean

Whether the costPerKilometerBelowSoftMax field is set.

hasMaxMeters()

publicabstractbooleanhasMaxMeters()

A hard limit constraining the distance to be at most max_meters. The limit must be nonnegative.

optional int64 max_meters = 1;

Returns
Type Description
boolean

Whether the maxMeters field is set.

hasSoftMaxMeters()

publicabstractbooleanhasSoftMaxMeters()

A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.

If defined soft_max_meters must be less than max_meters and must be nonnegative.

optional int64 soft_max_meters = 2;

Returns
Type Description
boolean

Whether the softMaxMeters field is set.

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.