Let’s suppose that we have Order A, and the driver has completed the pickup of the order.
Order A:
- Pickup(completed).
- Delivery(pending).
And in middle of the path the driver takes a new order, Order B is closer to the driver than order A.
Although the order A is partially completed, order B is rescheduled as first stop, which it makes to the driver pasts again to the pickup A already completed.
- B pickup(pending).
- B delivery(pending).
- A pickup(completed).
- A delivery (pending).
I know that this is an expected behavior if a new order comes, but this is a common use of case. Is there a way to flag or mark a restriction on those stops. I used the priority params in the pickup stop, but it doesn’t work.
This is the example:
{
"vehicles": [
{
"vehicle_id": "91",
"start_address": {
"location_id": "current_driver_location",
"lat": 10.713273,
"lon": -71.625449
},
"return_to_depot": false
}
],
"vehicle_types": [{ "type_id": "91", "profile": "car" }],
"relations": [
{
"type": "in_same_route",
"ids": ["6491", "6490", "6405", "6404"],
"vehicle_id": "91"
}
],
"configuration": {
"routing": { "calc_points": true, "return_snapped_waypoints": true }
},
"objectives": [{ "type": "min", "value": "completion_time" }],
"services": [
{
"id": "6405",
"type": "pickup",
"address": {
"location_id": "109",
"lat": 10.6759282,
"lon": -71.6030925
},
"size": [1]
},
{
"id": "6404",
"type": "delivery",
"address": {
"location_id": "168",
"lat": 10.6703253,
"lon": -71.6050455
},
"size": [1]
},
{
"id": "6491",
"type": "pickup",
"address": {
"location_id": "253",
"lat": 10.6983333,
"lon": -71.62527779999999
},
"size": [1]
},
{
"id": "6490",
"type": "delivery",
"address": {
"location_id": "254",
"lat": 10.6775569,
"lon": -71.60101449999999
},
"size": [1]
}
],
"shipments": [
{
"id": "A_pickup_completed",
"name": "A",
"pickup": {
"address": {
"location_id": "109",
"lat": 10.6759282,
"lon": -71.6030925
}
},
"delivery": {
"address": {
"location_id": "168",
"lat": 10.6703253,
"lon": -71.6050455
}
}
},
{
"id": "B_new_order",
"name": "B",
"pickup": {
"address": {
"location_id": "253",
"lat": 10.6983333,
"lon": -71.62527779999999
}
},
"delivery": {
"address": {
"location_id": "254",
"lat": 10.6775569,
"lon": -71.60101449999999
}
}
}
]
}
Any help it will be appreciated.
Thanks.