Apply service time only on start and end locations
Posted: Fri Jun 03, 2022 1:19 pm
Hi,
I`m using the xServer2 xTourClient.planTours method to get optimized tours based on my orders.
I have a scenario where I would like to have a fixed service time but only on the start and end location of the tour.
If the same location is visited again in the middle of the tour, that service time should not be considered to that location.
Because of this I cannot simply use the ServiceTimePerStop property on the Site object because it would add that time on every tour stop that happens on the same location.
I`ve tried to add a 'fake' start&end locations that has the same coordinates as my actual tour start but just having a different ID and set the ServiceTimePerStop on it, and then set those locations as the start and end locations on ALL vehicles, hoping that like this it will apply the ServiceTimeOnTourStop value, but the response that I get the tour action duration is 0 for the 'fake' start/end locations.
This is part of my response object:
"tours": [
{
"vehicleId": "5637187371",
"vehicleStartLocationId": "111111", // this is my 'fake' start location that i set on each vehicle
"vehicleEndLocationId": "222222", // this is my 'fake' end location that i set on each vehicle
.
.
]
}
"tourEvents": [
{
"startTime": "2019-03-02T10:38:15Z",
"tripId": "",
"locationId": "111111", // the 'fake' start location
"orderId": null,
"eventTypes": [
7
],
"tourViolations": null,
"duration": 0.0 // the durations on the action on the '111111' location is 0
},
{
"startTime": "2019-03-02T10:38:15Z",
"tripId": "1d0be59f-fc7d-48aa-bd5e-4f53e5a34275",
"locationId": "111111", // the 'fake' start location
"orderId": null,
"eventTypes": [
5
],
"tourViolations": null,
"duration": 0.0 // the durations on the action on the '111111' location is 0
},
I have also tried to use the ptv2.26 AdditionalServiceTimePerStop property on the Depot site object but it only gets added if on that location we do a load or unload, else it`s get ignored (in our case it can happen that no load or unload is done on the start/end location).
Any suggestions how can I achieve my requirement?
Thanks,
Marko
I`m using the xServer2 xTourClient.planTours method to get optimized tours based on my orders.
I have a scenario where I would like to have a fixed service time but only on the start and end location of the tour.
If the same location is visited again in the middle of the tour, that service time should not be considered to that location.
Because of this I cannot simply use the ServiceTimePerStop property on the Site object because it would add that time on every tour stop that happens on the same location.
I`ve tried to add a 'fake' start&end locations that has the same coordinates as my actual tour start but just having a different ID and set the ServiceTimePerStop on it, and then set those locations as the start and end locations on ALL vehicles, hoping that like this it will apply the ServiceTimeOnTourStop value, but the response that I get the tour action duration is 0 for the 'fake' start/end locations.
This is part of my response object:
"tours": [
{
"vehicleId": "5637187371",
"vehicleStartLocationId": "111111", // this is my 'fake' start location that i set on each vehicle
"vehicleEndLocationId": "222222", // this is my 'fake' end location that i set on each vehicle
.
.
]
}
"tourEvents": [
{
"startTime": "2019-03-02T10:38:15Z",
"tripId": "",
"locationId": "111111", // the 'fake' start location
"orderId": null,
"eventTypes": [
7
],
"tourViolations": null,
"duration": 0.0 // the durations on the action on the '111111' location is 0
},
{
"startTime": "2019-03-02T10:38:15Z",
"tripId": "1d0be59f-fc7d-48aa-bd5e-4f53e5a34275",
"locationId": "111111", // the 'fake' start location
"orderId": null,
"eventTypes": [
5
],
"tourViolations": null,
"duration": 0.0 // the durations on the action on the '111111' location is 0
},
I have also tried to use the ptv2.26 AdditionalServiceTimePerStop property on the Depot site object but it only gets added if on that location we do a load or unload, else it`s get ignored (in our case it can happen that no load or unload is done on the start/end location).
Any suggestions how can I achieve my requirement?
Thanks,
Marko