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

Tutorials

Sourcing

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

Sourcing overview

Sourcing is a type of routing problem that’s applicable to use cases such as construction material transportation, dairy and produce transport, and waste management. In typical sourcing scenarios:

  • Requests include pickups only
  • Routes are often scheduled in advance and fixed
  • Vehicles can start anywhere
  • Vehicles end at the same location (e.g. warehouse, depot, etc.)

This tutorial provides a walkthrough of setting up a basic sourcing 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.

Sourcing defaults

The defaults for a sourcing scenario often include defining vehicle end location, 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.

"defaults": {
    "vehicles": {
        "end": {
            "lon": -96.659222,
            "lat": 33.122746
        },
        "shift_start": "2021-06-10T07:00:00-6:00",
        "shift_end": "2021-06-10T15:00:00-6:00",
        "speed": 12
    },
    "stops": {
        "stop_duration": 300
    }
}
Copy
Field nameNotes
startStarting position representing a depot or warehouse
shift_startTime that a vehicle shift begins
shift_endTime that a vehicle shift ends
speedAverage speed in meters per second
stop_durationEstimated amount of time in seconds to service a stop

Sourcing vehicles

Most sourcing 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.

"vehicles": [
    {
        "id": "Alice",
        "capacity": 200
    },
    {
        "id": "Bob",
        "capacity": 250
    },
    ...
]
Copy
Field nameNotes
idName or identifier for a given vehicle
capacityAvailable vehicle space for arbitrary entities (e.g., maximum weight, volume, etc. of a given vehicle)

Sourcing stops

Most sourcing scenarios typically start with values defined for stop id, position, and quantity. The quantity value in this case is always negative, in that it will reduce the capacity of a vehicle when it services that stop.

"stops": [
    {
        "id": "order-1",
        "position": {
            "lon": -96.71038245222624,
            "lat": 33.20580830033956
        },
        "quantity": -27
    },
    {
        "id": "order-2",
        "position": {
            "lon": -96.65613745932127,
            "lat": 33.2259142720506
        },
        "quantity": -30
    },
    {
        "id": "order-3",
        "position": {
            "lon": -96.63759803136642,
            "lat": 33.21528740544529
        },
        "quantity": -36
    },
    ...
]
Copy
Field nameNotes
idName or identifier for a given stop
positionCoordinates for a given stop
quantityArbitrary entities for transport (e.g., the weight, volume, etc. of a given stop)

Sourcing 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 sourcing 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 sourcing scenario.

Page last updated

Go to on-page nav menu