Mixing them is possible out of the box. So there is another reason why the order remained unplanned. This can be figured out with the findChangeTourProposal.
Note: since i do not know you parameters for building the dima I'm using Direct Distance in the rest of my explanation.
First of all: store the request en result server side when you do your initial planning by setting the PlanToursRequest.storeRequest to true.
Code: Select all
{
"$type": "ToursResponse",
"costReport": {
"travelTime": 31422,
"drivingTime": 17322,
"serviceTime": 11400,
"distance": 288665,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"tours": [
{
"vehicleId": "ADR_x05_39_0",
"vehicleStartLocationId": "15171",
"trips": [
{
"id": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"stops": [
{
"locationId": "15171",
"tasks": [
{
"orderId": "30176",
"taskType": "PICKUP"
}
]
},
{
"locationId": "605497",
"tasks": [
{
"orderId": "30176",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "605467",
"tasks": [
{
"orderId": "30172",
"taskType": "PICKUP"
}
]
},
{
"locationId": "15171",
"tasks": [
{
"orderId": "30172",
"taskType": "DELIVERY"
}
]
}
]
}
]
}
],
"tourReports": [
{
"vehicleId": "ADR_x05_39_0",
"costReport": {
"travelTime": 31422,
"drivingTime": 17322,
"serviceTime": 11400,
"distance": 288665,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"tripReports": [
{
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"costReport": {
"travelTime": 31422,
"drivingTime": 17322,
"serviceTime": 11400,
"distance": 288665,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
}
}
],
"tourEvents": [
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 4500
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 8429
},
{
"startTime": "2023-06-23T10:35:29.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605497",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T10:55:29.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 251
},
{
"startTime": "2023-06-23T10:59:40.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605467",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T11:19:40.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 7520
},
{
"startTime": "2023-06-23T13:25:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"BREAK"
],
"duration": 2700
},
{
"startTime": "2023-06-23T14:10:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 1122
},
{
"startTime": "2023-06-23T14:28:42.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"duration": 4500
},
{
"startTime": "2023-06-23T15:43:42.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_END"
],
"duration": 0
},
{
"startTime": "2023-06-23T15:43:42.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_END"
],
"duration": 0
}
],
"legReports": [
{
"startTourEventIndex": 3,
"endTourEventIndex": 3,
"drivingTime": 8429,
"distance": 140477,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 5,
"endTourEventIndex": 5,
"drivingTime": 251,
"distance": 4170,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 7,
"endTourEventIndex": 9,
"drivingTime": 8642,
"distance": 144018,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
}
]
}
],
"orderIdsNotPlanned": [
"30191"
],
"vehicleIdsWithDirectDistanceEstimation": [
"ADR_x05_39_0"
],
"violated": false,
"routeViolated": false,
"storedRequestId": "d9462192-4596-4a13-a7bb-8848066b8721"
}
No you can use findChangeTourProposal. Use the InsertionPositionsForOrdersQuery type for the proposalsQuery and in the proposalsOptions set returnViolatedTours to true.
Code: Select all
{
"$type": "ChangeToursProposalsResponse",
"proposals": [
{
"changeToursAction": {
"$type": "MoveOrdersAction",
"storedRequestId": "d9462192-4596-4a13-a7bb-8848066b8721",
"orderIds": [
"30191"
],
"targetTripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"pickupInsertionPosition": {
"$type": "InsertionBeforeSpecifiedPosition",
"position": 0
},
"deliveryInsertionPosition": {
"$type": "InsertionAfterSpecifiedPosition",
"position": 0
}
},
"tours": [
{
"vehicleId": "ADR_x05_39_0",
"vehicleStartLocationId": "15171",
"trips": [
{
"id": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"stops": [
{
"locationId": "15171",
"tasks": [
{
"orderId": "30176",
"taskType": "PICKUP"
},
{
"orderId": "30191",
"taskType": "PICKUP"
}
]
},
{
"locationId": "605825",
"tasks": [
{
"orderId": "30191",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "605497",
"tasks": [
{
"orderId": "30176",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "605467",
"tasks": [
{
"orderId": "30172",
"taskType": "PICKUP"
}
]
},
{
"locationId": "15171",
"tasks": [
{
"orderId": "30172",
"taskType": "DELIVERY"
}
]
}
]
}
]
}
],
"tourReports": [
{
"vehicleId": "ADR_x05_39_0",
"costReport": {
"travelTime": 33520,
"drivingTime": 18220,
"serviceTime": 12600,
"distance": 303616,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"violationReport": {
"$type": "TourViolationReport",
"maximumOpeningIntervalExceedance": 220,
"restPositionViolated": false,
"customerStopPositionInTripViolated": false,
"tripSectionViolated": false,
"compartmentAccessViolated": false
},
"tripReports": [
{
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"costReport": {
"travelTime": 33520,
"drivingTime": 18220,
"serviceTime": 12600,
"distance": 303616,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"violationReport": {
"$type": "TripViolationReport",
"maximumOpeningIntervalExceedance": 220,
"restPositionViolated": false,
"customerStopPositionInTripViolated": false,
"tripSectionViolated": false,
"compartmentAccessViolated": false
}
}
],
"tourEvents": [
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 4500
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30191",
"eventTypes": [
"SERVICE"
],
"duration": 0
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 7910
},
{
"startTime": "2023-06-23T10:26:50.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605825",
"orderId": "30191",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T10:46:50.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 1417
},
{
"startTime": "2023-06-23T11:10:27.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605497",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T11:30:27.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 251
},
{
"startTime": "2023-06-23T11:34:38.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605467",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T11:54:38.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 6622
},
{
"startTime": "2023-06-23T13:45:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"BREAK"
],
"duration": 2700
},
{
"startTime": "2023-06-23T14:30:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 2020
},
{
"startTime": "2023-06-23T15:03:40.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"tourViolations": [
{
"$type": "TimeViolation",
"causedByThisEvent": true,
"type": "OPENING_INTERVAL",
"exceedance": 220
}
],
"duration": 4500
},
{
"startTime": "2023-06-23T16:18:40.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_END"
],
"duration": 0
},
{
"startTime": "2023-06-23T16:18:40.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_END"
],
"duration": 0
}
],
"legReports": [
{
"startTourEventIndex": 4,
"endTourEventIndex": 4,
"drivingTime": 7910,
"distance": 131826,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 6,
"endTourEventIndex": 6,
"drivingTime": 1417,
"distance": 23602,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 8,
"endTourEventIndex": 8,
"drivingTime": 251,
"distance": 4170,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 10,
"endTourEventIndex": 12,
"drivingTime": 8642,
"distance": 144018,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
}
]
}
],
"violated": true,
"preferencesRespected": true
},
{
"changeToursAction": {
"$type": "MoveOrdersAction",
"storedRequestId": "d9462192-4596-4a13-a7bb-8848066b8721",
"orderIds": [
"30191"
],
"targetTripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"pickupInsertionPosition": {
"$type": "InsertionBeforeSpecifiedPosition",
"position": 0
},
"deliveryInsertionPosition": {
"$type": "InsertionAfterSpecifiedPosition",
"position": 2
}
},
"tours": [
{
"vehicleId": "ADR_x05_39_0",
"vehicleStartLocationId": "15171",
"trips": [
{
"id": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"stops": [
{
"locationId": "15171",
"tasks": [
{
"orderId": "30191",
"taskType": "PICKUP"
},
{
"orderId": "30176",
"taskType": "PICKUP"
}
]
},
{
"locationId": "605497",
"tasks": [
{
"orderId": "30176",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "605467",
"tasks": [
{
"orderId": "30172",
"taskType": "PICKUP"
}
]
},
{
"locationId": "605825",
"tasks": [
{
"orderId": "30191",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "15171",
"tasks": [
{
"orderId": "30172",
"taskType": "DELIVERY"
}
]
}
]
}
]
}
],
"tourReports": [
{
"vehicleId": "ADR_x05_39_0",
"costReport": {
"travelTime": 33525,
"drivingTime": 18225,
"serviceTime": 12600,
"distance": 303714,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"violationReport": {
"$type": "TourViolationReport",
"maximumOpeningIntervalExceedance": 225,
"restPositionViolated": false,
"customerStopPositionInTripViolated": false,
"tripSectionViolated": false,
"compartmentAccessViolated": false
},
"tripReports": [
{
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"costReport": {
"travelTime": 33525,
"drivingTime": 18225,
"serviceTime": 12600,
"distance": 303714,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"violationReport": {
"$type": "TripViolationReport",
"maximumOpeningIntervalExceedance": 225,
"restPositionViolated": false,
"customerStopPositionInTripViolated": false,
"tripSectionViolated": false,
"compartmentAccessViolated": false
}
}
],
"tourEvents": [
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30191",
"eventTypes": [
"SERVICE"
],
"duration": 4500
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 0
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 8429
},
{
"startTime": "2023-06-23T10:35:29.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605497",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T10:55:29.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 251
},
{
"startTime": "2023-06-23T10:59:40.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605467",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T11:19:40.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 1635
},
{
"startTime": "2023-06-23T11:46:55.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605825",
"orderId": "30191",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T12:06:55.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 5885
},
{
"startTime": "2023-06-23T13:45:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"BREAK"
],
"duration": 2700
},
{
"startTime": "2023-06-23T14:30:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 2025
},
{
"startTime": "2023-06-23T15:03:45.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"tourViolations": [
{
"$type": "TimeViolation",
"causedByThisEvent": true,
"type": "OPENING_INTERVAL",
"exceedance": 225
}
],
"duration": 4500
},
{
"startTime": "2023-06-23T16:18:45.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_END"
],
"duration": 0
},
{
"startTime": "2023-06-23T16:18:45.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_END"
],
"duration": 0
}
],
"legReports": [
{
"startTourEventIndex": 4,
"endTourEventIndex": 4,
"drivingTime": 8429,
"distance": 140477,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 6,
"endTourEventIndex": 6,
"drivingTime": 251,
"distance": 4170,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 8,
"endTourEventIndex": 8,
"drivingTime": 1635,
"distance": 27241,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 10,
"endTourEventIndex": 12,
"drivingTime": 7910,
"distance": 131826,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
}
]
}
],
"violated": true,
"preferencesRespected": true
},
{
"changeToursAction": {
"$type": "MoveOrdersAction",
"storedRequestId": "d9462192-4596-4a13-a7bb-8848066b8721",
"orderIds": [
"30191"
],
"targetTripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"pickupInsertionPosition": {
"$type": "InsertionBeforeSpecifiedPosition",
"position": 0
},
"deliveryInsertionPosition": {
"$type": "InsertionAfterSpecifiedPosition",
"position": 1
}
},
"tours": [
{
"vehicleId": "ADR_x05_39_0",
"vehicleStartLocationId": "15171",
"trips": [
{
"id": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"stops": [
{
"locationId": "15171",
"tasks": [
{
"orderId": "30191",
"taskType": "PICKUP"
},
{
"orderId": "30176",
"taskType": "PICKUP"
}
]
},
{
"locationId": "605497",
"tasks": [
{
"orderId": "30176",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "605825",
"tasks": [
{
"orderId": "30191",
"taskType": "DELIVERY"
}
]
},
{
"locationId": "605467",
"tasks": [
{
"orderId": "30172",
"taskType": "PICKUP"
}
]
},
{
"locationId": "15171",
"tasks": [
{
"orderId": "30172",
"taskType": "DELIVERY"
}
]
}
]
}
]
}
],
"tourReports": [
{
"vehicleId": "ADR_x05_39_0",
"costReport": {
"travelTime": 35423,
"drivingTime": 20123,
"serviceTime": 12600,
"distance": 335338,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"violationReport": {
"$type": "TourViolationReport",
"maximumOpeningIntervalExceedance": 2123,
"restPositionViolated": false,
"customerStopPositionInTripViolated": false,
"tripSectionViolated": false,
"compartmentAccessViolated": false
},
"tripReports": [
{
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"costReport": {
"travelTime": 35423,
"drivingTime": 20123,
"serviceTime": 12600,
"distance": 335338,
"monetaryCostsReport": {
"totalCost": 0,
"travelTimeCost": 0,
"distanceCost": 0,
"fixedCost": 0
}
},
"violationReport": {
"$type": "TripViolationReport",
"maximumOpeningIntervalExceedance": 2123,
"restPositionViolated": false,
"customerStopPositionInTripViolated": false,
"tripSectionViolated": false,
"compartmentAccessViolated": false
}
}
],
"tourEvents": [
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_START"
],
"duration": 0
},
{
"startTime": "2023-06-23T07:00:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30191",
"eventTypes": [
"SERVICE"
],
"duration": 4500
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 0
},
{
"startTime": "2023-06-23T08:15:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 8429
},
{
"startTime": "2023-06-23T10:35:29.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605497",
"orderId": "30176",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T10:55:29.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 1417
},
{
"startTime": "2023-06-23T11:19:06.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605825",
"orderId": "30191",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T11:39:06.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 1635
},
{
"startTime": "2023-06-23T12:06:21.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "605467",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"duration": 1200
},
{
"startTime": "2023-06-23T12:26:21.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 4719
},
{
"startTime": "2023-06-23T13:45:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"BREAK"
],
"duration": 2700
},
{
"startTime": "2023-06-23T14:30:00.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"eventTypes": [
"DRIVING"
],
"duration": 3923
},
{
"startTime": "2023-06-23T15:35:23.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"orderId": "30172",
"eventTypes": [
"SERVICE"
],
"tourViolations": [
{
"$type": "TimeViolation",
"causedByThisEvent": true,
"type": "OPENING_INTERVAL",
"exceedance": 2123
}
],
"duration": 4500
},
{
"startTime": "2023-06-23T16:50:23.000+02:00",
"tripId": "13dfaa4a-245f-4859-92c9-fc04e6289fc4",
"locationId": "15171",
"eventTypes": [
"TRIP_END"
],
"duration": 0
},
{
"startTime": "2023-06-23T16:50:23.000+02:00",
"locationId": "15171",
"eventTypes": [
"TOUR_END"
],
"duration": 0
}
],
"legReports": [
{
"startTourEventIndex": 4,
"endTourEventIndex": 4,
"drivingTime": 8429,
"distance": 140477,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 6,
"endTourEventIndex": 6,
"drivingTime": 1417,
"distance": 23602,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 8,
"endTourEventIndex": 8,
"drivingTime": 1635,
"distance": 27241,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
},
{
"startTourEventIndex": 10,
"endTourEventIndex": 12,
"drivingTime": 8642,
"distance": 144018,
"estimatedByDirectDistance": true,
"routeViolated": false,
"maximumQuantityScenarioIndex": 0
}
]
}
],
"violated": true,
"preferencesRespected": true
}
]
}
Now you can iterate through the ChangeToursProposalsResponse.proposals and see what is going wrong and find a common cause. I usually look at the ChangeToursProposal.tourReports[].violationReport . In this case I'm seeing maximumOpeningIntervalExceedance in all the proposals. So the tour simply because to long in time to back at the depot to unload.
Note: i used DirectDistance, if you use an actual dima it probably lead to a different outcome, but i reckon that the cause will still be something time related
Note 2: This function does not scale well with large plans since it tries every possible option. For larger plans I do recommend taking a look at the maximumNumberOfMoveOrdersActions and maximumDistanceOfAdjacentStops and setting them to appropriate values for you plan.