Features

Vehicle start/end time

A how-to guide for using vehicle starting and ending times with vehicle routing.

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 nameRequiredData typeSI UnitDefined onExampleConfigurable via defaults
start_timeNotimestampNAvehicle{"start_time": "2023-01-01T00:00:00Z"}
end_timeNotimestampNAvehicle{"end_time": "2023-01-01T00:00:00Z"}

You can specify the time at which a vehicle starts its route, with the start_time. By default, there are no arrival or departure times given for vehicles at stops in the solution. When you specify the start_time for a vehicle, there is context for when the route starts, and thus, there are timestamps calculated as part of the output, such as the arrival_time for each stop.

In addition to the start time, you can also define the latest time at which a vehicle must end its route, with the end_time. Defining both the start_time and end_time defines a shift for the vehicle. Please note that the end_time includes any time spent traveling, waiting at stops, and servicing them.

Both the start_time and end_time are optional.

When defining start_time and end_time 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.

Defining the start_time on the vehicle makes it possible to calculate the arrival_time, start_time and end_time for the vehicle's planned stops in the output.

Here is an example input defining the start_time and end_time for some vehicles. Note how defining different attributes for each vehicle leads to distinct route information. A sample output obtained after solving the problem is also shown.

{
  "defaults": {
    "vehicles": {
      "speed": 5
    },
    "stops": {
      "duration": 600
    }
  },
  "stops": [
    {
      "id": "Fushimi Inari Taisha",
      "location": { "lon": 135.772695, "lat": 34.967146 }
    },
    {
      "id": "Kiyomizu-dera",
      "location": { "lon": 135.78506, "lat": 34.994857 }
    },
    {
      "id": "Nijō Castle",
      "location": { "lon": 135.748134, "lat": 35.014239 }
    },
    {
      "id": "Kyoto Imperial Palace",
      "location": { "lon": 135.762057, "lat": 35.025431 }
    },
    {
      "id": "Gionmachi",
      "location": { "lon": 135.775682, "lat": 35.002457 }
    },
    {
      "id": "Kinkaku-ji",
      "location": { "lon": 135.728898, "lat": 35.039705 }
    },
    {
      "id": "Arashiyama Bamboo Forest",
      "location": { "lon": 135.672009, "lat": 35.017209 }
    }
  ],
  "vehicles": [
    {
      "id": "v1"
    },
    {
      "id": "v2",
      "start_location": {
        "lon": 135.772695,
        "lat": 34.967146
      },
      "start_time": "2023-01-01T12:00:00Z"
    },
    {
      "id": "v3",
      "end_location": {
        "lon": 135.762057,
        "lat": 35.025431
      },
      "start_time": "2023-01-01T12:00:00Z",
      "end_time": "2023-01-01T12:20:00Z"
    },
    {
      "id": "v4",
      "start_location": {
        "lon": 135.775683,
        "lat": 35.002458
      },
      "end_location": {
        "lon": 135.775683,
        "lat": 35.002458
      },
      "start_time": "2023-01-01T12:00:00Z",
      "end_time": "2023-01-01T12:30:00Z"
    }
  ]
}
Copy

Page last updated