This feature is configurable via .json
input, without the need for code customization and is available for both the Marketplace app and Platform. You can find a list of all available features here.
This how-to guide assumes you already completed the get started with vehicle routing tutorial.
Field name | Required | Data type | SI Unit | Defined on | Example | Configurable via defaults |
---|---|---|---|---|---|---|
max_duration | No | int | seconds | vehicle | {"max_duration": 123} | ✅ |
It may be useful to set a hard limit on the maximum duration of a route for a vehicle. For example, if the vehicle or vehicle driver has a limited availability. This limit can be set via the max_duration
feature on vehicles. The duration is given in seconds
.
Please note that the max_duration
includes any time spent traveling, waiting at stops, and servicing them.
When defining start_time
and end_time
on a vehicle there is a time duration defined by end_time - start_time
. The route duration is limited by the most constrained duration between end_time - start_time
and max_duration
.
Here is an example defining different maximum durations for vehicles. A sample output obtained after solving the problem is also shown.