Hi, I am using the route optimization API and facing an issue with existing appointments occasionally being overlapped with new ones.
Minimal example one appointment 10-11, another time window 9-5:
{ "vehicles": [ { "vehicle_id": "71", "start_address": { "location_id": "vehicle_location-71", "lat": 45.5345814, "lon": -73.5434827 }, "type_id": "vehicle_type_1", "earliest_start": 1548666000, "latest_end": 1548694800, "return_to_depot": false } ], "vehicle_types": [ { "type_id": "vehicle_type_1", "profile": "car" } ], "services": [ { "id": "appointment-209", "name": null, "address": { "location_id": "appointment_location-209", "lat": 45.4877, "lon": -73.59721 }, "duration": 3600, "time_windows": [ { "earliest": 1548669600, "latest": 1548673200 } ], "allowed_vehicles": [ 71 ], "priority": 1 }, { "id": "appointment-190", "name": null, "address": { "location_id": "appointment_location-190", "lat": 45.4959, "lon": -73.59541 }, "duration": 3600, "time_windows": [ { "earliest": 1548666000, "latest": 1548676800 } ] } ] }
Returns arr_time
of the new appointment before the end of the first (10am) sometimes.
I’d like to restrict the 9-10 interval completely, so it is not really a time window but a blocked off portion of time.
How to do this? Is there a way to specify instead of a time window that the time is inaccessible? Do I need to subtract from subsequent appointment windows instead? ie) 9-10, 11-5
"time_windows": [ { "earliest": 1548666000, "latest": 1548669600 }, { "earliest": 1548673200, "latest": 1548694800 } ]
And similar time window changes as appointments are blocked off? That too does not seem like it would work - as if I have three vehicles [A,B,C], then Vehicle A might be blocked off already from 10-11, but B and C would not be.
I also tried using relations
of "type":"in_same_route"
but received the error "code":21,"reason":"could not be assigned due to relation constraint"
Thank-you