Features

Duration groups

A how-to guide for using duration groups with vehicle routing.

  • This feature is configurable via .json input, without the need for code customization.
  • Available for both the Marketplace app and Platform. You can find a list of all available features here.
Field nameRequiredData typeSI UnitDefined onExampleConfigurable via defaults
duration_groupsNoarray of duration_groupNAinput{"duration_groups": [{"group":["foo", "bar"], "duration": 200}]
  • duration_group

    Field nameRequiredData typeSI UnitDescriptionExample
    groupYesarray of stringNAStop IDs contained in the group.{"group": ["foo", "bar"]}
    durationYesintsecondsDuration to add when visiting the group.{"duration": 5}

Duration groups allow you to define an overhead duration that is added to the stops' regular duration each time a stop of the group is approached from a stop that is not part of the group. Duration groups are used with the duration_groups feature which defines an array of duration_group. Each duration_group holds a group (array of string) and a duration (int) in seconds.

Here is an example defining duration groups. A sample output obtained after solving the problem is also shown.

{
  "defaults": {
    "vehicles": {
      "speed": 20
    }
  },
  "duration_groups": [
    {
      "group": ["Fushimi Inari Taisha", "Kiyomizu-dera"],
      "duration": 100
    },
    {
      "group": ["Gionmachi", "Kinkaku-ji"],
      "duration": 200
    },
    {
      "group": ["Arashiyama Bamboo Forest", "Nijō Castle"],
      "duration": 300
    }
  ],
  "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",
      "start_location": {
        "lon": 135.772695,
        "lat": 34.967146
      }
    }
  ]
}
Copy

Page last updated