New feature: max number of jobs and activities

We are happy to announce that you can now constraint the maximum number of jobs or activities in a route. It is as simple as adding the max_jobs or max_activities field like this:

"vehicles": [
    {
      "vehicle_id": "my_vehicle",
      "start_address": {
        "location_id": "berlin",
        "lon": 13.406,
        "lat": 52.537
      },
      "max_jobs":2
    }
  ]

In this specific example the vehicle with id “my_vehicle” cannot conduct more than two pickups or more than two services, or it cannot load more than two shipments. If you use “max_activities”, the vehicle cannot conduct more than two activities. If you deal with services, the number of services are equal to the number of activities. However, if you deal with shipments, the number of activities is equal to 2*shipments since each shipment involves two activities, i.e. pickup and delivery.

If there are jobs that cannot be assiged due to these constraints, the API responds with this:

{
        "id": "frankfurt",
        "code": 27,
        "reason": "could not be assigned due to max job constraint"
}
1 Like