You are viewing Nextmv legacy docs. ⚡️ Go to latest docs ⚡️

Cloud

Route Limits

You will learn the basics of using route limits on cloud.

Route limits are useful when constraining routes for individual or all vehicles. These limits are so-called hard constraints, hence, the limits cannot be exceeded by the routes they are applicable to.

Max stops

It may be useful to limit the number of stops in a route to a particular amount. This can simply be done with the max_stops attribute for one vehicle (on the vehicle itself) or globally for all vehicles (in the defaults/vehicles section). Individual vehicle settings take precedence over global settings.

{
  "defaults": {
    "vehicles": {
      "shift_start": "2021-08-24T09:00:00-06:00",
      "speed": 10
    }
  },
  "vehicles": [
    {
      "id": "vehicle-1",
      // Limit number of stops for this vehicle to 3
      "max_stops": 3
    },
    {
      "id": "vehicle-2",
      // Limit number of stops for this vehicle to 2
      "max_stops": 2
    }
  ],
  "stops": [
    { "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
    { "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
    { "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
    { "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
    { "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
  ]
}
Copy

Max distance

It may be useful to limit the distance a vehicle can travel. For example, if the vehicle has a limited range. This limit can be set via the max_distance attribute for one vehicle (on the vehicle itself) or globally for all vehicles (in the defaults/vehicles section). Individual vehicle settings take precedence over global settings. The distance is given in meters.

{
  "defaults": {
    "vehicles": {
      "shift_start": "2021-08-24T09:00:00-06:00",
      "speed": 10
    }
  },
  "vehicles": [
    {
      "id": "vehicle-1",
      // Limit distance of route for this vehicle to 2km
      "max_distance": 2000
    },
    {
      "id": "vehicle-2",
      // Limit distance of route for this vehicle to 3km
      "max_distance": 3000
    }
  ],
  "stops": [
    { "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
    { "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
    { "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
    { "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
    { "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
  ]
}
Copy

Max duration

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 the max_duration attribute for one vehicle (on the vehicle itself) or globally for all vehicles (in the defaults/vehicles section). Individual vehicle settings take precedence over global settings. The duration is given in seconds.

Note, there is a known accuracy issue in ETAs when combining hard_window & max_duration. We are working on a fix for this.

{
  "defaults": {
    "vehicles": {
      "shift_start": "2021-08-24T09:00:00-06:00",
      "speed": 10
    }
  },
  "vehicles": [
    {
      "id": "vehicle-1",
      // Limit duration of route for this vehicle to 4 minutes (240s)
      "max_duration": 240
    },
    {
      "id": "vehicle-2",
      // Limit duration of route for this vehicle to 5 minutes (300s)
      "max_duration": 300
    }
  ],
  "stops": [
    { "id": "location-1", "position": { "lon": 7.6129, "lat": 51.957 } },
    { "id": "location-2", "position": { "lon": 7.6166, "lat": 51.9635 } },
    { "id": "location-3", "position": { "lon": 7.6258, "lat": 51.9624 } },
    { "id": "location-4", "position": { "lon": 7.6386, "lat": 51.9449 } },
    { "id": "location-5", "position": { "lon": 7.5896, "lat": 51.9486 } }
  ]
}
Copy

Page last updated

Go to on-page nav menu