OptimizationMvrpService

A service solves for the optimization of a Multi(or single) vehicle routing problem.

Methods

Method
postVRP

postVRP(opt: OptimizationMvrpOrderRequest)


Parameters


  1. opt: OptimizationMvrpOrderRequest Deprecated

    Notes:
    the expected order for all coordinates arrays is [lon, lat]
    all timings are in seconds
    all distances are in meters
    a time_window object is a pair of timestamps in the form [start, end]
    cost values in output are the one used in the optimization objective (currently equal to duration)
    a "task" is either a job, a pickup or a delivery

Return Value: Promise


retrieve

retrieve(opt: OptimizationMvrpRetrieveRequest)


Parameters


  1. opt: OptimizationMvrpRetrieveRequest

Return Value: Promise


Interface OptimizationMvrpRetrieveRequest

Properties

Name
apiKey Optional

Type: string


api key for the request
id

Type: string


Unique Reference ID for the submitted VRP. It is the id returned from optimization POST response.

Interface OptimizationMvrpRetrieveResult

Notes:
the expected order for all coordinates arrays is [lon, lat]
all timings are in seconds
all distances are in meters
a time_window object is a pair of timestamps in the form [start, end]
cost values in output are the one used in the optimization objective (currently equal to duration)
a "task" is either a job, a pickup or a delivery

Properties

Name
description Optional

Type: string


This will return a value if it is set in the description top level property.
message

Type: string


Describe the error if one occurs during processing data
result

Type: OptimizationMvrpRetrieveResultData


status

Type: NBRequestStatus


Describes the process status

Interface OptimizationMvrpRetrieveResultData

Properties

Name
code Optional

Type: number


0: no error, 1: internal error, 2: input error, 3: routing error
error

Type: string


routes

Type: Array<OptimizationMvrpRoute>


summary

Type: OptimizationMvrpSummary


unassigned

Type: Array<OptimizationMvrpUnassigned>


Interface OptimizationMvrpUnassigned

Properties

Name
description Optional

Type: string


id Optional

Type: number


location Optional

Type: Array<number>


task_type Optional

Type: string


Interface OptimizationMvrpOrderRequest

Deprecated

Notes:
the expected order for all coordinates arrays is [lon, lat]
all timings are in seconds
all distances are in meters
a time_window object is a pair of timestamps in the form [start, end]
cost values in output are the one used in the optimization objective (currently equal to duration)
a "task" is either a job, a pickup or a delivery

Properties

Name
apiKey Optional

Type: string


api key for the request
depots Optional

Type: Array<OptimizationMvrpOrderDepot>


Describes the locations of depots
description Optional

Type: string


Text description of location.If set, this description will be returned in the response
jobs Optional

Type: Array<OptimizationMvrpOrderJob>


Array of job objects describing the stops/places to visit. Each Job object has the following parameters
locations

Type: OptimizationMvrpOrderLocation


This indicates the locations that will be used for optimization. The object contains the following parameters.
mode Optional

Type: string


A parameter which which sets the transportation mode for the route. PS: Only the 4w/car profile is enabled by default. The other customised routing profiles are only supported in premium plan.
shipments Optional

Type: Array<OptimizationMvrpOrderShipment>


The shipments object describes the pickup and delivery tasks
vehicles

Type: Array<OptimizationMvrpOrderVehicle>


vehicles is the array of vehicle objects with the following parameters.

Interface OptimizationMvrpOrderResult

Properties

Name
id

Type: string


message

Type: string


status

Type: NBRequestStatus


Interface OptimizationMvrpOrderJob

Properties

Name
delivery Optional

Type: Array<number>


an array of integers describing multidimensional quantities for delivery

Items in the array would refer to types of delivery objects and associated count for that object. For example, if your use case is flower delivery , position 0 in the array might be the number of roses to be delivered and position 1 in the array might be the number of tulips to be delivered at the location.
description Optional

Type: string


Description of the job
id

Type: number


Unique reference ID for the job
location_index

Type: number


Valid values are 0 to (No. of locations in the locations object -1)

Index of a location in the locations object which marks the latitude, longitude for the job
pickup Optional

Type: Array<number>


an array of integers describing multidimensional quantities for pickup. Items in the array would refer to types of pickup objects and associated count for that object. For example, if your use case is flower delivery , position 0 in the array might be the number of roses to be picked up and position 1 in the array might be the number of tulips to be picked up at the location.
priority Optional

Type: number


Default = 0 Valid values are 0 to 100

Describe the priority of this job. Priority only decides whether this job will be assigned, but will not necessarily influence the sequencing of the job.
service Optional

Type: number


Unit is seconds.

The service duration for this job (defaults to 0)
setup Optional

Type: number


The unit is in second. Its default value is 0.

Describe the job setup duration.
skills Optional

Type: Array<number>


An array of integers used to list the capabilities/attributes/skills for the job. These could be used to set a job attribute (EV - possibly in a low-emission zone), capability (cold storage, refuel), or driver skillset.
time_windows Optional

Type: Array<Array<number>>


An array of time_window objects describing valid slots for job service start. Each time_window object contains a start time and end time for the window.

Example: [[1656487800,1656516600],[1656570000,1656620000]]

Interface OptimizationMvrpOrderLocation

Properties

Name
id

Type: number


reference ID for the set of locations
location

Type: Array<LngLatLike>


The index into the list is used when setting job and vehicle locations.

Interface OptimizationMvrpOrderShipment

Properties

Name
amount Optional

Type: Array<number>


delivery

Type: { id: number,location_index: number,service: number,time_windows: Array<undefined> }


description Optional

Type: string


Description of the shipment
pickup

Type: { id: number,location_index: number,service: number,time_windows: Array<undefined> }


priority Optional

Type: number


Describe the priority of this shipment. The valid value is in range of [0, 100]. Its default value is 0 . Priority only decides whether this shipment will be assigned, but has nothing to do with the sequence of shipments.
skills Optional

Type: Array<number>


Describe the mandatory skills for this shipment

Interface OptimizationMvrpOrderVehicle

Properties

Name
breaks Optional

Type: { id: number,service: number,time_windows: Array<Array<number>> }


Describe the breaks the driver will take
capacity Optional

Type: Array<number>


depot Optional

Type: number


Describe the depot assigned to this vehicle
description Optional

Type: string


Description of the vehicle
end_index Optional

Type: number


id

Type: number


max_tasks Optional

Type: number


skills Optional

Type: Array<number>


start_index Optional

Type: number


time_window Optional

Type: undefined


Interface OptimizationMvrpOrderDepot

Properties

Name
description Optional

Type: string


Add a description for this depot
id

Type: number


Describe the id of this depot
location_index

Type: number


Describe the location of depot

Interface OptimizationMvrpSummary

Properties

Name
cost Optional

Type: number


delivery Optional

Type: Array<number>


distance Optional

Type: number


duration Optional

Type: number


num_late_visits Optional

Type: number


num_vehicle_overtime Optional

Type: number


pickup Optional

Type: Array<number>


prioriy Optional

Type: number


routes Optional

Type: number


service Optional

Type: number


setup Optional

Type: number


total_vehicle_overtime Optional

Type: number


total_visit_lateness Optional

Type: number


unassigned Optional

Type: number


violation Optional

Type: { cause: string,duration: number }


waiting_time Optional

Type: number


Interface OptimizationMvrpRoute

Properties

Name
cost Optional

Type: number


Describe the cost of this route. Right now it is equal to duration
delivery Optional

Type: Array<number>


Describe the total deliveries in this route
description Optional

Type: string


Description of the vehicle on the route
distance Optional

Type: number


Describe the total distance in this route
duration Optional

Type: number


Describe the duration of this route
geometry Optional

Type: string


geometry
pickup Optional

Type: Array<number>


Describe the total pickups in this route
priority Optional

Type: number


Describe the sum of priorities for this route
service Optional

Type: number


Describe the total service time for this route
setup Optional

Type: number


Describe the total setup time for this route
steps Optional

Type: Array<OptimizationMvrpRouteStep>


Describe the steps in this route
vehicle

Type: number


Describe the vehicle ID
vehicle_overtime

Type: number


The vehicle-overtime of this route
waiting_time Optional

Type: number


Describe the waiting time at this step

Interface OptimizationMvrpRouteStep

Properties

Name
arrival Optional

Type: number


Describe the arrival time at this step
description Optional

Type: string


Describe this step
duration Optional

Type: number


Describe the duration to this step. (The duration is accumulated here which means it includes the time spent on previous steps)
id Optional

Type: number


Describe the id of this task
late_by Optional

Type: number


Describe the visit-lateness of this step
load Optional

Type: Array<number>


Describe the load of the vehicle after the completion of this step
location Optional

Type: Array<number>


Describe the coordinate at this step
location_index Optional

Type: number


Describe the location index at this step
service

Type: number


Describe the service duration at this step
setup

Type: number


Describe the setup duration at this step
type

Type: string


Describe the task type of this step
violation Optional

Type: Array<{ cause: string,duration: number }>


Describe the violations in this step
waiting_time Optional

Type: number


Describe the waiting time at this step

Constants TravelMode

The transportation mode for the route.

Constants
AUTOdefault mode, same as car
CARcar mode
TRUCKtruck mode

© 2024 NextBillion.ai all rights reserved.