Delivery
You will learn the basics of a delivery use case on cloud.

Delivery overview

Delivery is a type of routing problem that’s applicable to use cases such as food and beverage delivery and ride sharing. In typical delivery scenarios:
  • Requests or stops include pickups and dropoffs
  • Routes are often made in real time and can change
  • Vehicles may start and end their routes at different locations
This tutorial provides a walkthrough of setting up a basic delivery scenario and includes a sample JSON input file to serve as a starting point. You can use the input file directly in the Nextmv Cloud console or with the Nextmv Cloud API.

Delivery defaults

The defaults for a delivery scenario often include defining vehicle shift start and end, vehicle speed, and stop duration. Specific properties applied to the stops and vehicles override default settings. Learn more about input schema defaults.
JSON
"defaults": {
"vehicles": {
"shift_start": "2021-06-10T07:00:00-6:00",
"shift_end": "2021-06-10T15:00:00-6:00",
"speed": 12
},
"stops": {
"stop_duration": 300
}
}
Field name
Notes
start
Starting position representing a depot or warehouse
shift_start
Time that a vehicle shift begins
shift_end
Time that a vehicle shift ends
speed
Average speed in meters per second
stop_duration
Estimated amount of time in seconds to service a stop

Delivery vehicles

Most delivery scenarios typically start with values defined for vehicle id and capacity. Latitude and longitude can be defined for a start location. If one isn’t provided, the vehicle starts its route at the first stop.
JSON
"vehicles": [
{
"id": "Alice",
"capacity": 300,
"start": {
"lon": -96.649135,
"lat": 33.26546
}
},
{
"id": "Bob",
"capacity": 450,
"start": {
"lon": -96.659222,
"lat": 33.12746
}
},
...
]
Field name
Notes
id
Name or identifier for a given vehicle
capacity
Available vehicle space for arbitrary entities (e.g., maximum weight, volume, etc. of a given vehicle)

Delivery stops

Most delivery scenarios typically start with values defined for stop id, position, and quantity. The quantity value in this case can be positive or negative, indicating an increase or decrease in vehicle capacity when it services that stop.
JSON
"stops": [
{
"id": "order-1-pickup-1",
"position": {
"lon": -96.827094,
"lat": 33.004745
},
"precedes": "order-1-dropoff",
"quantity": -27
},
{
"id": "order-1-dropoff",
"position": {
"lon": -96.86074,
"lat": 33.005741
},
"quantity": 27
},
...
]
Field name
Notes
id
Name or identifier for a given stop
position
Coordinates for a given stop
quantity
Arbitrary entities for transport (e.g., the weight, volume, etc. of a given stop), can be positive or negative value

Delivery next steps

The Nextmv Cloud API is extremely flexible. There are many ways you can configure the input file to represent more complex business logic using penalties, time windows, and compatibility attributes.

Sample delivery input data

The following is a complete sample of input data you can use with the Nextmv Cloud console or Nextmv Cloud API to get started with a basic delivery scenario.
delivery.json
11KB
Code
Input file