Solution
The Solution entity represents the Vehicle Routing Problem solution which consists of three important parts: statistic, tours, and unassigned jobs.
statistic
statisticthe statistic object represents the statistic of one or multiple tours and consists of the following properties:
-
cost: total cost in abstract units rounded to three decimal places
"cost": 54.459 -
distance: total driven distance in meters
"distance": 35277 -
duration: total duration in seconds
duration": 5286 -
consumption: estimated fuel consumption, with the unit type corresponding to the fuel type, for example, for CNG, the unit is kilograms while for petrol, the unit is liters
consumption: 6.3893 -
co2Emission: the estimated CO₂ emission for the tour, in kilograms
co2Emission: 17.232999999999997 -
intraStopDistance: in clustering, the total distance (in meters) between activities inside all the stops plus the way back to the stop locations. If all stop locations are equal to all activity locations (for example, a stop includes a single activity only), this value is 0.
intraStopDistance: 1024 -
times: times spent for driving, serving jobs, waiting for time window start, stopping, break, and walking between activities within stops
{ "times": { "driving": 5106, "serving": 180, "waiting": 0, "stopping": 0, "break": 0, "intraStop": 0 } }
The duration property in a solution's statistic represents the total sum of all tour durations for that specific solution.
List of tours
Each item of the tour list provides detailed information about the used vehicle and the assigned jobs.
-
typeId: specifies vehicle type id
"typeId": "myVehicle" -
vehicleId: specifies concrete id of the used vehicle. It consists of typeId and a sequential number separated by underscore
vehicleId": "myVehicle_1" -
stops: specifies the list of stops
-
statistic: specifies tour statistic
-
shiftIndex: specifies which vehicle shift index will be used during the tour.
stop
stopThe stop specifies the list of activities performed at a specific time, at a specific place. It consists of the following properties:
-
location: stop location represented via latitude/longitude
"location": {"lat": 52.52568, "lng": 13.45345} -
time: specifies expected arrival and departure time at/from stop
{ "time": { "arrival": "2020-07-04T09:19:01Z", "departure": "2020-07-04T09:19:01Z" } } -
load: specifies vehicle load after departure from the stop
"load": [1] -
distance: specifies total distance traveled from the tour start (in meters)
-
intraStopDistance: specifies the total distance (in meters) between activities in this stop plus the way back to the stop location. If the stop location is equal to all activity locations in the stop, this value equals
0. -
activities: specifies list of activities to be performed at the stop
Note
The
timesin the solution results will always be returned in UTC regardless of what time offset was used in the problem formulation.
activity
activityIn general, activity specifies a planned task to be performed at a specific location and time. It consists of the following properties:
-
jobId: id of the job or marker (e.g. break, departure or arrival)
jobId": "myJob" -
type: specifies the activity type. It can be one of the following values: departure, arrival, break, pickup, delivery
"type": "delivery" -
jobTag (optional): a user defined value specified on the corresponding job place
"jobTag": "place 1" -
location (optional): the activity location represented via latitude/longitude or custom ID. Omitted when it is the same as the one defined at the parent stop
"location": {"lat": 52.52568, "lng": 13.45345}or"location": {"id": "uniqueLocationId""} -
time (optional) : specifies expected arrival, start, and end times for the activity. The
arrivaltime indicates when the vehicle/person arrives at the activity location, whilestartandendindicate when the activity itself begins and finishes. Omitted if there is only one activity in the stop{ "time": { "arrival": "2020-07-04T10:00:00Z", "start": "2020-07-04T10:00:00Z", "end": "2020-07-04T10:03:00Z" } }Note
The
timesin the solution results are always returned in the UTC format regardless of what time offset was used in the problem formulation.
unassigned jobs
unassigned jobsThe optional unassigned job list is populated with jobs which cannot be assigned due to specific constraints. Each item consists of a job id and possible unassignment reasons:
{
"unassigned": [
{
"jobId": "myJob",
"reasons": [
{
"code": "MAX_DISTANCE_CONSTRAINT",
"description": "cannot be assigned due to max distance constraint of vehicle"
}
]
}
]
}Example
{
"statistic": {
"cost": 54.459916,
"distance": 35277,
"duration": 5286,
"times": {
"driving": 5106,
"serving": 180,
"waiting": 0,
"stopping": 0,
"break": 0,
"intraStop": 0
},
"intraStopDistance": 0
},
"tours": [
{
"vehicleId": "myVehicle_1",
"typeId": "myVehicle",
"stops": [
{
"location": {"lat": 52.52568, "lng": 13.45345},
"time": {
"arrival": "2020-07-04T09:19:01Z",
"departure": "2020-07-04T09:19:01Z"
},
"load": [1],
"activities": [
{
"jobId": "departure",
"type": "departure",
"time": {
"arrival": "2020-07-04T09:19:01Z",
"start": "2020-07-04T09:19:01Z",
"end": "2020-07-04T09:19:01Z"
}
}
],
"distance": 0,
"intraStopDistance": 0
},
{
"location": {"lat": 52.46642, "lng": 13.28124},
"time": {
"arrival": "2020-07-04T10:00:00Z",
"departure": "2020-07-04T10:03:00Z"
},
"load": [0],
"activities": [
{
"jobId": "myJob",
"type": "delivery",
"time": {
"arrival": "2020-07-04T10:00:00Z",
"start": "2020-07-04T10:00:00Z",
"end": "2020-07-04T10:03:00Z"
}
}
],
"distance": 16035,
"intraStopDistance": 0
},
{
"location": {"lat": 52.52568, "lng": 13.45345},
"time": {
"arrival": "2020-07-04T10:47:07Z",
"departure": "2020-07-04T10:47:07Z"
},
"load": [0],
"activities": [
{
"jobId": "arrival",
"type": "arrival",
"time": {
"arrival": "2020-07-04T10:47:07Z",
"start": "2020-07-04T10:47:07Z",
"end": "2020-07-04T10:47:07Z"
}
}
],
"distance": 31943,
"intraStopDistance": 0
}
],
"statistic": {
"cost": 54.459916,
"distance": 35277,
"duration": 5286,
"times": {
"driving": 5106,
"serving": 180,
"waiting": 0,
"stopping": 0,
"break": 0,
"intraStop": 0
},
"intraStopDistance": 0
},
"shiftIndex": 0
}
]
}Updated 29 days ago