Hello,
I am having a hard time with the (Unix) timestamps that I need to specify for the time-windows of the services.
Not all of my stops have a time-window, but some do. When they have a time-window I would like that these stops are included in the route.
I think that I am now sending in the correct Unix timestamps.
However, the stops that I defined a time window for, are the ones that are not included in the tour.
I also gave these stops a higher priority of 1 to indicate that these should be included.
But still they appear in the Unassigned-array.
This leads me to think that I am not specifying the timestamps in the correct way.
However, I checked them using https://www.epochconverter.com/ and they look fine to me.
Could you please explain what I am doing wrong?
I already looked at other tips from this forum and changed:
- the calculation of the timestamps (to no success)
- the latest of the time-window (minus the duration of the task), but that also does not help
The tour below should start at April 21 at 16:00 hours.
The defined time windows should be between 16:00 and 18:00 (minus some slack time and the end time is minus the duration of the stop).
Thank you in advance!
Request:
{
"vehicles": [
{
"vehicle_id": "#DUMMY#",
"start_address": {
"location_id": "1c84c9b4-507a-445d-a958-85a7d7632f92",
"lat": 50.94676,
"lon": 5.77035
},
"end_address": {
"location_id": "1c84c9b4-507a-445d-a958-85a7d7632f92",
"lat": 50.94676,
"lon": 5.77035
},
"earliest_start": 1650549600
}
],
"services": [
{
"id": "17885bf5-4c28-4fa6-8f3e-357aa15cb5e5",
"name": "Order: Paintball tour test 5 (Genieweg 44, Velsen-Zuid)",
"address": {
"location_id": "17885bf5-4c28-4fa6-8f3e-357aa15cb5e5",
"lat": 52.4318281,
"lon": 4.6721175
},
"duration": 900,
"group": "rest",
"time_windows": [
{
"earliest": 1650547800,
"latest": 1650557700
}
],
"priority": 1
},
{
"id": "82886fc1-70fa-4cc1-9f4f-671fcc6e81cc",
"name": "Order: Paintball tour test 5 (Stille Steeg Oost 6, Amersfoort)",
"address": {
"location_id": "82886fc1-70fa-4cc1-9f4f-671fcc6e81cc",
"lat": 52.1842932,
"lon": 5.3875359
},
"duration": 900,
"group": "start",
"time_windows": [],
"priority": 2
},
{
"id": "1089d43e-296d-4fb3-b2c6-e780b19a710e",
"name": "Order: Paintball tour test 5 (Wandelweg 12, Wormerveer)",
"address": {
"location_id": "1089d43e-296d-4fb3-b2c6-e780b19a710e",
"lat": 52.2354536,
"lon": 4.794703
},
"duration": 900,
"group": "rest",
"time_windows": [
{
"earliest": 1650547800,
"latest": 1650557700
}
],
"priority": 1
},
{
"id": "bfa082b6-ca33-4a38-863c-994c731a6035",
"name": "Order: Paintball tour test 5 (kerkertuinenweg 29, Den Haag)",
"address": {
"location_id": "bfa082b6-ca33-4a38-863c-994c731a6035",
"lat": 52.0488043,
"lon": 4.2599819
},
"duration": 900,
"group": "rest",
"time_windows": [],
"priority": 2
},
{
"id": "28ed155b-ccbd-466d-85e0-03e5116b927c",
"name": "Order: Paintball tour test 5 (Oosterweg 5, Eijsden)",
"address": {
"location_id": "28ed155b-ccbd-466d-85e0-03e5116b927c",
"lat": 50.806075,
"lon": 5.705802
},
"duration": 900,
"group": "rest",
"time_windows": [],
"priority": 2
},
{
"id": "a4770bd9-beb9-4e91-a1f2-b2a3d34e2a01",
"name": "Order: Paintball tour test 5 (Molbergsweg 1, Deventer)",
"address": {
"location_id": "a4770bd9-beb9-4e91-a1f2-b2a3d34e2a01",
"lat": 52.2391525,
"lon": 6.2040809
},
"duration": 900,
"group": "rest",
"time_windows": [],
"priority": 2
},
{
"id": "af24edc4-d37e-4cf1-a371-3a5562deb4b2",
"name": "Order: Paintball tour test 5 (Wedderbergenweg 3, Wedde)",
"address": {
"location_id": "af24edc4-d37e-4cf1-a371-3a5562deb4b2",
"lat": 53.083311,
"lon": 7.074122
},
"duration": 900,
"group": "rest",
"time_windows": [],
"priority": 2
},
{
"id": "3f938132-dd75-4fe3-ab03-532d844fffbe",
"name": "Order: Paintball tour test 5 (Ampèrestraat 3 d, Nijkerk)",
"address": {
"location_id": "3f938132-dd75-4fe3-ab03-532d844fffbe",
"lat": 52.2270981,
"lon": 5.4793942
},
"duration": 900,
"group": "end",
"time_windows": [],
"priority": 2
}
],
"relations": [
{
"type": "in_direct_sequence",
"groups": [
"start",
"rest",
"end"
]
}
]
}
Response:
{
"copyrights": [
"GraphHopper",
"OpenStreetMap contributors"
],
"job_id": "353f8650-118b-4f3b-bfd1-db01f2e30883",
"status": "finished",
"waiting_time_in_queue": 0,
"processing_time": 259,
"solution": {
"costs": 999,
"distance": 1229477,
"time": 51408,
"transport_time": 51408,
"completion_time": 56808,
"max_operation_time": 56808,
"waiting_time": 0,
"service_duration": 5400,
"preparation_time": 0,
"no_vehicles": 1,
"no_unassigned": 2,
"routes": [
{
"vehicle_id": "#DUMMY#",
"shift_id": "default-shift",
"distance": 1229477,
"transport_time": 51408,
"completion_time": 56808,
"waiting_time": 0,
"service_duration": 5400,
"preparation_time": 0,
"activities": [
{
"type": "start",
"location_id": "1c84c9b4-507a-445d-a958-85a7d7632f92",
"address": {
"location_id": "1c84c9b4-507a-445d-a958-85a7d7632f92",
"lat": 50.94676,
"lon": 5.77035
},
"end_time": 1650549600,
"end_date_time": null,
"distance": 0,
"driving_time": 0,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": null,
"arr_time": null,
"arr_date_time": null,
"load_before": null
},
{
"type": "service",
"location_id": "82886fc1-70fa-4cc1-9f4f-671fcc6e81cc",
"address": {
"location_id": "82886fc1-70fa-4cc1-9f4f-671fcc6e81cc",
"lat": 52.1842932,
"lon": 5.3875359
},
"end_time": 1650558162,
"end_date_time": null,
"distance": 188851,
"driving_time": 7662,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": "82886fc1-70fa-4cc1-9f4f-671fcc6e81cc",
"arr_time": 1650557262,
"arr_date_time": null,
"load_before": [
0
]
},
{
"type": "service",
"location_id": "bfa082b6-ca33-4a38-863c-994c731a6035",
"address": {
"location_id": "bfa082b6-ca33-4a38-863c-994c731a6035",
"lat": 52.0488043,
"lon": 4.2599819
},
"end_time": 1650563569,
"end_date_time": null,
"distance": 291729,
"driving_time": 12169,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": "bfa082b6-ca33-4a38-863c-994c731a6035",
"arr_time": 1650562669,
"arr_date_time": null,
"load_before": [
0
]
},
{
"type": "service",
"location_id": "28ed155b-ccbd-466d-85e0-03e5116b927c",
"address": {
"location_id": "28ed155b-ccbd-466d-85e0-03e5116b927c",
"lat": 50.806075,
"lon": 5.705802
},
"end_time": 1650573655,
"end_date_time": null,
"distance": 519800,
"driving_time": 21355,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": "28ed155b-ccbd-466d-85e0-03e5116b927c",
"arr_time": 1650572755,
"arr_date_time": null,
"load_before": [
0
]
},
{
"type": "service",
"location_id": "a4770bd9-beb9-4e91-a1f2-b2a3d34e2a01",
"address": {
"location_id": "a4770bd9-beb9-4e91-a1f2-b2a3d34e2a01",
"lat": 52.2391525,
"lon": 6.2040809
},
"end_time": 1650582865,
"end_date_time": null,
"distance": 730513,
"driving_time": 29665,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": "a4770bd9-beb9-4e91-a1f2-b2a3d34e2a01",
"arr_time": 1650581965,
"arr_date_time": null,
"load_before": [
0
]
},
{
"type": "service",
"location_id": "af24edc4-d37e-4cf1-a371-3a5562deb4b2",
"address": {
"location_id": "af24edc4-d37e-4cf1-a371-3a5562deb4b2",
"lat": 53.083311,
"lon": 7.074122
},
"end_time": 1650590448,
"end_date_time": null,
"distance": 870444,
"driving_time": 36348,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": "af24edc4-d37e-4cf1-a371-3a5562deb4b2",
"arr_time": 1650589548,
"arr_date_time": null,
"load_before": [
0
]
},
{
"type": "service",
"location_id": "3f938132-dd75-4fe3-ab03-532d844fffbe",
"address": {
"location_id": "3f938132-dd75-4fe3-ab03-532d844fffbe",
"lat": 52.2270981,
"lon": 5.4793942
},
"end_time": 1650598527,
"end_date_time": null,
"distance": 1046183,
"driving_time": 43527,
"preparation_time": 0,
"waiting_time": 0,
"load_after": [
0
],
"id": "3f938132-dd75-4fe3-ab03-532d844fffbe",
"arr_time": 1650597627,
"arr_date_time": null,
"load_before": [
0
]
},
{
"type": "end",
"location_id": "1c84c9b4-507a-445d-a958-85a7d7632f92",
"address": {
"location_id": "1c84c9b4-507a-445d-a958-85a7d7632f92",
"lat": 50.94676,
"lon": 5.77035
},
"end_time": 0,
"end_date_time": null,
"distance": 1229477,
"driving_time": 51408,
"preparation_time": 0,
"waiting_time": 0,
"load_after": null,
"id": null,
"arr_time": 1650606408,
"arr_date_time": null,
"load_before": [
0
]
}
]
}
],
"unassigned": {
"services": [
"17885bf5-4c28-4fa6-8f3e-357aa15cb5e5",
"1089d43e-296d-4fb3-b2c6-e780b19a710e"
],
"shipments": [],
"breaks": [],
"details": [
{
"id": "17885bf5-4c28-4fa6-8f3e-357aa15cb5e5",
"code": 2,
"reason": "cannot be visited within time window"
},
{
"id": "1089d43e-296d-4fb3-b2c6-e780b19a710e",
"code": 2,
"reason": "cannot be visited within time window"
}
]
}
}
}