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.
The format for timestamps should be RFC3339
, e.g.: "2023-01-01T00:00:00Z"
.
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 |
---|---|---|---|---|---|---|
target_arrival_time | No | timestamp | NA | stop | {"target_arrival_time": "2023-01-01T00:00:00Z"} | ✅ |
late_arrival_time_penalty | No | float | NA | stop | {"late_arrival_time_penalty": 1.23} | ✅ |
The late_arrival_time_penalty
is a cost applied to the objective (value function) when a vehicle arrives at a stop after the given target_arrival_time
. These fields are defined on stops, and are useful for discouraging behavior such as hot food being delivered too late.
The value added to the objective is calculated as follows:
For example, if a vehicle arrives at a stop 60 seconds after a target arrival time and the penalty is set to 10, 600 seconds are added to the value function.
Please note that:
- The time duration given by
arrival_time - target_arrival_time
is inseconds
. - When defining a
late_arrival_time_penalty
on a stop, you must also define atarget_arrival_time
for that stop. - Specifying
late_arrival_time_penalty
andtarget_arrival_time
on a stoplate_arrival_duration
of the stop defines the time duration given by brings additional information on the output. For example, thearrival_time - target_arrival_time
in seconds, when greater than zero.
Here is an example defining penalties for all stops. A sample output obtained after solving the problem is also shown.