DistanceLimit

A limit defining a maximum distance which can be traveled. It can be either hard or soft.

If a soft limit is defined, both softMaxMeters and costPerKilometerAboveSoftMax must be defined and be nonnegative.

JSON representation
{
  "maxMeters": string,
  "softMaxMeters": string,
  "costPerKilometerBelowSoftMax": number,
  "costPerKilometerAboveSoftMax": number
}
Fields
maxMeters

string (int64 format)

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

softMaxMeters

string (int64 format)

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 softMaxMeters must be less than maxMeters and must be nonnegative.

costPerKilometerBelowSoftMax

number

Cost per kilometer incurred, increasing up to softMaxMeters, with formula:

  min(distanceMeters, softMaxMeters) / 1000.0 *
  costPerKilometerBelowSoftMax.

This cost is not supported in routeDistanceLimit.

costPerKilometerAboveSoftMax

number

Cost per kilometer incurred if distance is above softMaxMeters limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following:

  (distanceMeters - softMaxMeters) / 1000.0 *
  costPerKilometerAboveSoftMax.

The cost must be nonnegative.