Intermediate depots
Intermediate Depots
To enable Intermediate Depots, it is mandatory to set capacity_threshold
and time_threshold
upon Route creation and vehicle_capacity
upon Resource creation.
Find more information about these entities in the Route, Resource and Event reference pages.
POST Routes¶
curl https://{root_url}/bucket-planning/v2/buckets/49a0cbbc-0c6d-43c6-8544-44a1d761207c/routes/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}'
-d '{
"algorithm_fields": {
"departure_stop": {
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 60.0
},
"arrival_stop": {
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T14:59:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z"
},
{
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T10:00:00Z"
},
{
"min_time": "2020-08-24T10:00:00Z",
"max_time": "2020-08-24T14:58:00Z"
},
{
"min_time": "2020-08-24T14:58:00Z",
"max_time": "2020-08-24T14:59:00Z"
}
],
"break_duration": 900,
"break_interval": 10800
},
"capacity_threshold": 0.8,
"time_threshold": 0.7,
"minimum_trip_length": 7200,
"intermediate_depot_duration": 1800,
"external_data": {},
"route_event_tags": []
}'
{
"id": "9f610690-91b1-4702-9efe-2cfd74662785",
"algorithm_fields": {
"departure_stop": {
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 60.0
},
"arrival_stop": {
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T14:59:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z"
},
{
"id": null,
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T10:00:00Z"
},
{
"id": null,
"min_time": "2020-08-24T10:00:00Z",
"max_time": "2020-08-24T14:58:00Z"
},
{
"id": null,
"min_time": "2020-08-24T14:58:00Z",
"max_time": "2020-08-24T14:59:00Z"
}
],
"break_duration": 900,
"break_interval": 10800
},
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"resource": null,
"events": [],
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2020-08-21T07:39:52Z",
"modified": "2020-08-21T07:39:52Z",
"external_data": {},
"capacity_threshold": 0.8,
"time_threshold": 0.7,
"minimum_trip_length": 7200,
"intermediate_depot_duration": 1800,
"route_event_tags": []
}
POST Routes in Bulk¶
curl https://{root_url}/bucket-planning/v2/buckets/49a0cbbc-0c6d-43c6-8544-44a1d761207c/routes/bulk/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}'
-d '[
{
"algorithm_fields": {
"departure_stop": {
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 60.0
},
"arrival_stop": {
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T14:59:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z"
},
{
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T10:00:00Z"
},
{
"min_time": "2020-08-24T10:00:00Z",
"max_time": "2020-08-24T14:58:00Z"
},
{
"min_time": "2020-08-24T14:58:00Z",
"max_time": "2020-08-24T14:59:00Z"
}
],
"break_duration": 900,
"break_interval": 10800
},
"capacity_threshold": 0.8,
"time_threshold": 0.7,
"minimum_trip_length": 7200,
"intermediate_depot_duration": 1800,
"external_data": {},
"route_event_tags": []
},
{
"algorithm_fields": {
"departure_stop": {
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z",
"geo_point": {
"latitude": 51.54321,
"longitude": 4.54321
},
"stop_time": 60.0
},
"arrival_stop": {
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T14:59:00Z",
"geo_point": {
"latitude": 51.54321,
"longitude": 4.54321
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z"
},
{
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T10:00:00Z"
},
{
"min_time": "2020-08-24T10:00:00Z",
"max_time": "2020-08-24T14:58:00Z"
},
{
"min_time": "2020-08-24T14:58:00Z",
"max_time": "2020-08-24T14:59:00Z"
}
],
"break_duration": 900,
"break_interval": 10800
},
"capacity_threshold": 0.8,
"time_threshold": 0.7,
"minimum_trip_length": 7200,
"intermediate_depot_duration": 1800,
"external_data": {},
"route_event_tags": []
}
]'
[
{
"id": "9f610690-91b1-4702-9efe-2cfd74662785",
"algorithm_fields": {
"departure_stop": {
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 60.0
},
"arrival_stop": {
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T14:59:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z"
},
{
"id": null,
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T10:00:00Z"
},
{
"id": null,
"min_time": "2020-08-24T10:00:00Z",
"max_time": "2020-08-24T14:58:00Z"
},
{
"id": null,
"min_time": "2020-08-24T14:58:00Z",
"max_time": "2020-08-24T14:59:00Z"
}
],
"break_duration": 900,
"break_interval": 10800
},
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"resource": null,
"events": [],
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2020-08-21T07:39:52Z",
"modified": "2020-08-21T07:39:52Z",
"external_data": {},
"capacity_threshold": 0.8,
"time_threshold": 0.7,
"minimum_trip_length": 7200,
"intermediate_depot_duration": 1800,
"route_event_tags": []
},
{
"id": "0e1b9140-72f4-4365-870d-d778d8196686",
"algorithm_fields": {
"departure_stop": {
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 60.0
},
"arrival_stop": {
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T14:59:00Z",
"geo_point": {
"latitude": 51.12345,
"longitude": 4.12345
},
"stop_time": 0.0
},
"timeslot_windows": [
{
"id": null,
"min_time": "2020-08-24T05:59:00Z",
"max_time": "2020-08-24T06:00:00Z"
},
{
"id": null,
"min_time": "2020-08-24T06:00:00Z",
"max_time": "2020-08-24T10:00:00Z"
},
{
"id": null,
"min_time": "2020-08-24T10:00:00Z",
"max_time": "2020-08-24T14:58:00Z"
},
{
"id": null,
"min_time": "2020-08-24T14:58:00Z",
"max_time": "2020-08-24T14:59:00Z"
}
],
"break_duration": 900,
"break_interval": 10800
},
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"resource": null,
"events": [],
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2020-08-21T07:39:52Z",
"modified": "2020-08-21T07:39:52Z",
"external_data": {},
"capacity_threshold": 0.8,
"time_threshold": 0.7,
"minimum_trip_length": 7200,
"intermediate_depot_duration": 1800,
"route_event_tags": []
},
]
POST Resources¶
curl https://{root_url}/bucket-planning/v2/buckets/49a0cbbc-0c6d-43c6-8544-44a1d761207c/resources/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '{
"algorithm_fields": {},
"driver_capacity": 1000.0,
"vehicle_capacity": 900.0,
"external_data": {}
}
'
{
"id": "82da378f-5d1c-42d4-90f8-085537c04745",
"algorithm_fields": {},
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2020-08-21T07:45:21Z",
"modified": "2020-08-21T07:45:21Z",
"external_data": {},
"vehicle_capacity": 900.0,
"driver_capacity": 1000.0,
"resource_event_tags": []
}
POST Resources in Bulk¶
curl https://{root_url}/bucket-planning/v2/buckets/49a0cbbc-0c6d-43c6-8544-44a1d761207c/resources/bulk/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '[
{
"algorithm_fields": {},
"driver_capacity": 1000.0,
"vehicle_capacity": 900.0,
"external_data": {},
"resource_event_tags": [],
},
{
"algorithm_fields": {},
"driver_capacity": 1000.0,
"vehicle_capacity": 800.0,
"external_data": {},
"resource_event_tags": [],
}
]'
[
{
"id": "82da378f-5d1c-42d4-90f8-085537c04745",
"algorithm_fields": {},
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2020-08-21T07:45:21Z",
"modified": "2020-08-21T07:45:21Z",
"external_data": {},
"vehicle_capacity": 900.0,
"driver_capacity": 1000.0,
"resource_event_tags": []
},
{
"id": "951753-1f53-43f5-8f93-6ae4cdc5fe8c",
"algorithm_fields": {},
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"current_state": "new",
"old_state": "empty",
"state_reason": null,
"created": "2020-08-21T07:45:21Z",
"modified": "2020-08-21T07:45:21Z",
"external_data": {},
"vehicle_capacity": 800.0,
"driver_capacity": 1000.0,
"resource_event_tags": []
}
]
POST Events¶
curl https://{root_url}/bucket-planning/v2/buckets/49a0cbbc-0c6d-43c6-8544-44a1d761207c/events/ \
-H 'Content-Type: application/json' \
-H 'apikey: {YOUR_API_KEY}' \
-d '{
"algorithm_fields": {
"stop_time": 690.0,
"capacity": 2.8,
},
"geo_point": {
"latitude": 52.3067349,
"longitude": 4.6768368
},
"min_time": "2017-11-13T17:00:00Z",
"max_time": "2017-11-13T22:00:00Z",
"external_data": {}
}
'
{
"id": "9a4a4e8a-4e01-4751-b636-aca89d705759",
"algorithm_fields": {
"stop_time": 690.0,
"capacity": 2.8,
"eta": "2017-11-13T21:45Z",
"time_to_next": 1106.0,
"dist_to_next": 19198.0
},
"event_type": "delivery",
"address": {},
"geo_point": {
"latitude": 52.3067349,
"longitude": 4.6768368
},
"min_time": "2017-11-13T17:00:00Z",
"max_time": "2017-11-13T22:00:00Z",
"sort_key": 12,
"bucket": "49a0cbbc-0c6d-43c6-8544-44a1d761207c",
"route": "9f610690-91b1-4702-9efe-2cfd74662785",
"current_state": "planned",
"old_state": "initialized",
"state_reason": "_/9a4a4e8a-4e01-4751-b636-aca89d705759",
"created": "2020-09-02T11:49:46Z",
"modified": "2020-09-02T12:02:17Z",
"external_data": {},
"resource_event_tags": [],
"route_event_tags": []
}