Vehicle types

A vehicle types are defined by fleet.types property and their schema has the following properties:

  • typeId (required): a vehicle type id
        "typeId": "vehicle",
  • vehicleIds (required): a list of concrete vehicle ids available for usage.
        "vehicleIds": [
          "vehicle_1"
        ],
  • profile (required): a name of routing profile
        "profile": "normal_car",
  • costs (required): specifies how expensive is vehicle usage. It has three properties:

    • fixed: a fixed cost per vehicle tour
    • time: a cost per time unit
    • distance: a cost per distance unit
  • shifts (required): specify one or more vehicle shift. See detailed description below.

  • capacity (required): specifies vehicle capacity symmetric to job demand

        "capacity": [
          10
        ]
  • skills (optional): vehicle skills needed by some jobs
        "skills": [
          "handyman"
        ]
  • limits (optional): vehicle limits. There are two:

    • shiftTime (optional): max shift time

    • maxDistance (optional): max distance

    • tourSize (optional): max amount of activities in the tour (without departure/arrival)

    • allowedAreas (optional): a list of areas where vehicle is allowed to serve jobs. Each area is defined by:

      • priority (optional): an area priority, bigger value - less important. You can use this property to prioritize jobs in one area over another.
      • outerShape (required): closed polygon specified by coordinates. No area restrictions when omitted.

An example:

      {
        "typeId": "vehicle",
        "vehicleIds": [
          "vehicle_1"
        ],
        "profile": "normal_car",
        "costs": {
          "fixed": 22.0,
          "distance": 0.0002,
          "time": 0.004806
        },
        "shifts": [
          {
            "start": {
              "earliest": "2019-07-04T09:00:00Z",
              "location": {
                "lat": 52.5316,
                "lng": 13.3884
              }
            },
            "end": {
              "latest": "2019-07-04T18:00:00Z",
              "location": {
                "lat": 52.5316,
                "lng": 13.3884
              }
            }
          }
        ],
        "capacity": [
          10
        ]
      }

Shift

Essentially, shift specifies vehicle constraints such as time, start/end locations, etc.:

          {
            "start": {
              "earliest": "2019-07-04T09:00:00Z",
              "location": {
                "lat": 52.5316,
                "lng": 13.3884
              }
            },
            "end": {
              "latest": "2019-07-04T18:00:00Z",
              "location": {
                "lat": 52.5316,
                "lng": 13.3884
              }
            }
          }

At least one shift has to be specified. More than one vehicle shift with different times means that this vehicle can be used more than once. This is useful for multi day scenarios. An example can be found here.

Each shift can have the following properties:

  • start (required) specifies vehicle start place defined via location, earliest (required) and latest (optional) departure time
  • end (optional) specifies vehicle end place defined via location, earliest (reserved) and latest (required) arrival time. When omitted, then vehicle ends on last job location
  • dispatch (optional) a list of dispatch places. When specified, shift start location is not considered as depot and vehicle has to navigate first to one of these places to load goods with dispatching constraints. Check example here
  • breaks (optional) a list of vehicle breaks. A break is specified by:
    • time window or interval after which a break should happen (e.g. between 3 or 4 hours after start)
    • duration of the break
    • optional locations. When present, one of locations is used for break. If it is omitted then break is stick to location of job served before break. Please not that break is soft constraint and can be unassigned in some cases due to other hard constraints, such as time windows. See example here
  • reloads (optional) a list of vehicle reloads. A reload is a place where vehicle can load new deliveries and unload pickups. It can be used to model multi trip routes. See examples here.

Related errors