Vehicle types

A vehicle types are defined by fleet.vehicles 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 vehicle profile which is defined by two properties:
    • matrix (required) : a name of matrix profile
    • scale (optional): duration scale applied to all travelling times (default is 1.0)
        "profile": {
          "matrix": "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:

    • maxDuration (optional): max tour duration
    • maxDistance (optional): max tour distance
    • tourSize (optional): max amount of activities in the tour (without departure/arrival). Please note, that clustered activities are counted as one in case of vicinity clustering.

An example:

      {
        "typeId": "vehicle",
        "vehicleIds": [
          "vehicle_1"
        ],
        "profile": {
          "matrix": "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.:

        "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
              }
            }
          }
        ],

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

  • breaks (optional) a list of vehicle breaks. There are two types of breaks:

    • required: this break is guaranteed to be assigned at cost of flexibility. It has the following properties:
      • time (required): a fixed time or time offset interval when the break should happen specified by earliest and latest properties. The break will be assigned not earlier, and not later than the range specified.
      • duration (required): duration of the break
    • optional: although such break is not guaranteed for assignment, it has some advantages over required break:
      • arbitrary break location is supported
      • the algorithm has more flexibility for assignment It is specified by:
      • time (required): time window or time offset interval after which a break should happen (e.g. between 3 or 4 hours after start).
      • places: list of alternative places defined by location (optional), duration (required) and tag (optional). If location of a break is omitted then break is stick to location of a job served before break.
      • policy (optional): a break skip policy. Possible values:
        • skip-if-no-intersection: allows to skip break if actual tour schedule doesn't intersect with vehicle time window (default)
        • skip-if-arrival-before-end: allows to skip break if vehicle arrives before break's time window end.

    Please note that optional break is a soft constraint and can be unassigned in some cases due to other hard constraints, such as time windows. You can control its unassignment weight using specific property on minimize-unassigned objective. See example here

    Additionally, offset time interval requires departure time optimization to be disabled explicitly (see E1307).

  • 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. Each reload has optional and required fields:

    • location (required): an actual place where reload activity happens
    • duration (required): duration of reload activity
    • times (optional): reload time windows
    • tag (optional): a tag which will be propagated back within the corresponding reload activity in solution
    • resourceId (optional): a shared reload resource id. It is used to limit amount of deliveries loaded at this reload. See examples here.
  • recharges (optional, experimental) specifies recharging stations and max distance limit before recharge should happen. See examples here.