Multi-pass schedules
In some problems where an operation may be delivered / collected in several visits in the same transport plan, the time constraint may be different on each of the visits.
To ensure this constraint is respected, make sure to use the parameter pg1241 with a value of 0 or 2. While it works in most cases with other values of this parameter, we do not guarantee that it will be respected.
Define multi-pass time profiles​
Example of a multi-pass time profile:
- The first visit to the site must be from 16:00 to 16:30 on Friday
- The second and third visits to the site must be from 19:00 to 19:30 on Friday
- The next visits must be from 22:00 to 22:30 on Friday
"timeProfiles": [
{
"id": "PROFIL_HORAIRE_1",
"openingTime": {
"nbPassages": 1,
"recurrentTimeWindows": [
{
"days": [
"FRIDAY"
],
"startTime": "16:00",
"timeRange": 1800,
"timeZone": "Europe/Paris"
}
]
},
"timeOtherPassages": [
{
"nbPassages": 2,
"recurrentTimeWindows": [
{
"days": [
"FRIDAY"
],
"startTime": "19:00",
"timeRange": 1800,
"timeZone": "Europe/Paris"
}
]
},
{
"recurrentTimeWindows": [
{
"days": [
"FRIDAY"
],
"startTime": "22:00",
"timeRange": 1800,
"timeZone": "Europe/Paris"
}
]
}
]
}
When the nbPassages field is not specified, the associated schedules can be used for an unlimited number of visits
Associate time profiles with sites​
"sites": [
{
"id": "SITE_1",
"coordinates": {
"latitude": 47.46257,
"longitude": -0.56151
},
"timesProfilesForLoading": [
{
"idProfile": "PROFIL_HORAIRE_1"
}
]
}
The Solution​
If an operation is done on a different visit than the one associated with it in the problem, this change is specified in the output, in modifiedData:
"modifiedData": [
{
"resultingOperation": {
"id": "OPERATION_3",
"type": "COLLECTION"
},
"resultingIdxPassage": 2
},
{
"resultingOperation": {
"id": "OPERATION_4",
"type": "COLLECTION"
},
"resultingIdxPassage": 3
},
{
"resultingOperation": {
"id": "OPERATION_2",
"type": "COLLECTION"
},
"resultingIdxPassage": 1
},
{
"resultingOperation": {
"id": "OPERATION_5",
"type": "COLLECTION"
},
"resultingIdxPassage": 4
}
]
The numbering of passage indices starts at 0.
In a subsequent calculation where we would have to reuse a solution with operations on a passage other than the first (index 0): remember to specify the index idxPassage to use on each operation:
"operations": [
{
"id": "OPERATION_1",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"volume": 10,
"idxPassage": 1
}
Full Problem
{
"sites": [
{
"id": "SITE_1",
"coordinates": {
"latitude": 47.46257,
"longitude": -0.56151
},
"timesProfilesForLoading": [
{
"idProfile": "PROFIL_HORAIRE_1"
}
]
}
,
{
"id": "DEPOT_1",
"coordinates": {
"latitude": 47.20586,
"longitude": -1.56435
},
"isDepot": true
}
],
"vehicleTypes": [
{
"id": "VEHTYPE_1",
"volumeCapacity": 10
}
],
"trucks": [
{
"id": "TRUCK_1",
"idVehicleType": "VEHTYPE_1",
"availablePeriods": [
{
"id": "PERIOD_1",
"timeWindow": {
"start": "2020-12-11T16:30+01:00",
"end": "2020-12-12T16:30+01:00"
}
}
]
},
{
"id": "TRUCK_2",
"idVehicleType": "VEHTYPE_1",
"availablePeriods": [
{
"id": "PERIOD_1",
"timeWindow": {
"start": "2020-12-11T16:30+01:00",
"end": "2020-12-12T16:30+01:00"
}
}
]
}
],
"timeProfiles": [
{
"id": "PROFIL_HORAIRE_1",
"openingTime": {
"nbPassages": 1,
"recurrentTimeWindows": [
{
"days": [
"FRIDAY"
],
"startTime": "16:00",
"timeRange": 1800,
"timeZone": "Europe/Paris"
}
]
},
"timeOtherPassages": [
{
"nbPassages": 2,
"recurrentTimeWindows": [
{
"days": [
"FRIDAY"
],
"startTime": "19:00",
"timeRange": 1800,
"timeZone": "Europe/Paris"
}
]
},
{
"recurrentTimeWindows": [
{
"days": [
"FRIDAY"
],
"startTime": "22:00",
"timeRange": 1800,
"timeZone": "Europe/Paris"
}
]
}
]
}
],
"routeProfile": {
"calculationParameters": [
{
"code": "pg1650",
"value": 2
}
]
},
"operations": [
{
"id": "OPERATION_1",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"volume": 10
},
{
"id": "OPERATION_2",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"volume": 10
},
{
"id": "OPERATION_3",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"volume": 10
},
{
"id": "OPERATION_4",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"volume": 10
},
{
"id": "OPERATION_5",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"volume": 10
}
]
}
Full Solution
{
"vehicleRoutes": [
{
"truck": "TRUCK_1",
"period": "PERIOD_1",
"routes": [
{
"id": "NewRoute_1_1",
"activities": [
{
"activity": "ROUTE_START",
"timeWindow": {
"start": "2020-12-11T15:30:00Z",
"end": "2020-12-11T15:30:00Z"
},
"site": "SITE_1"
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T15:30:00Z",
"end": "2020-12-11T15:30:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_1"
}
]
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T15:30:00Z",
"end": "2020-12-11T16:31:18Z"
},
"departureSite": "SITE_1",
"arrivalSite": "DEPOT_1",
"distance": 89964,
"nominalDuration": 3678
},
{
"activity": "UNLOADING",
"timeWindow": {
"start": "2020-12-11T16:31:18Z",
"end": "2020-12-11T16:31:18Z"
},
"site": "DEPOT_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_1"
}
]
},
{
"activity": "ROUTE_END",
"timeWindow": {
"start": "2020-12-11T16:31:18Z",
"end": "2020-12-11T16:31:18Z"
},
"site": "DEPOT_1"
}
]
},
{
"id": "NewRoute_1_2",
"activities": [
{
"activity": "ROUTE_START",
"timeWindow": {
"start": "2020-12-11T16:32:18Z",
"end": "2020-12-11T16:32:18Z"
},
"site": "DEPOT_1"
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T16:32:18Z",
"end": "2020-12-11T17:32:31Z"
},
"departureSite": "DEPOT_1",
"arrivalSite": "SITE_1",
"distance": 92784,
"nominalDuration": 3613
},
{
"activity": "WAITING",
"timeWindow": {
"start": "2020-12-11T17:32:31Z",
"end": "2020-12-11T18:00:00Z"
},
"site": "SITE_1"
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T18:00:00Z",
"end": "2020-12-11T18:00:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_3"
}
]
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T18:00:00Z",
"end": "2020-12-11T19:01:18Z"
},
"departureSite": "SITE_1",
"arrivalSite": "DEPOT_1",
"distance": 89964,
"nominalDuration": 3678
},
{
"activity": "UNLOADING",
"timeWindow": {
"start": "2020-12-11T19:01:18Z",
"end": "2020-12-11T19:01:18Z"
},
"site": "DEPOT_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_3"
}
]
},
{
"activity": "ROUTE_END",
"timeWindow": {
"start": "2020-12-11T19:01:18Z",
"end": "2020-12-11T19:01:18Z"
},
"site": "DEPOT_1"
}
]
},
{
"id": "NewRoute_1_3",
"activities": [
{
"activity": "ROUTE_START",
"timeWindow": {
"start": "2020-12-11T19:02:18Z",
"end": "2020-12-11T19:02:18Z"
},
"site": "DEPOT_1"
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T19:02:18Z",
"end": "2020-12-11T20:02:31Z"
},
"departureSite": "DEPOT_1",
"arrivalSite": "SITE_1",
"distance": 92784,
"nominalDuration": 3613
},
{
"activity": "WAITING",
"timeWindow": {
"start": "2020-12-11T20:02:31Z",
"end": "2020-12-11T21:00:00Z"
},
"site": "SITE_1"
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T21:00:00Z",
"end": "2020-12-11T21:00:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_4"
}
]
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T21:00:00Z",
"end": "2020-12-11T22:01:18Z"
},
"departureSite": "SITE_1",
"arrivalSite": "DEPOT_1",
"distance": 89964,
"nominalDuration": 3678
},
{
"activity": "UNLOADING",
"timeWindow": {
"start": "2020-12-11T22:01:18Z",
"end": "2020-12-11T22:01:18Z"
},
"site": "DEPOT_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_4"
}
]
},
{
"activity": "ROUTE_END",
"timeWindow": {
"start": "2020-12-11T22:01:18Z",
"end": "2020-12-11T22:01:18Z"
},
"site": "DEPOT_1"
}
]
}
]
},
{
"truck": "TRUCK_2",
"period": "PERIOD_1",
"routes": [
{
"id": "NewRoute_2_1",
"activities": [
{
"activity": "ROUTE_START",
"timeWindow": {
"start": "2020-12-11T18:30:00Z",
"end": "2020-12-11T18:30:00Z"
},
"site": "SITE_1"
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T18:30:00Z",
"end": "2020-12-11T18:30:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_2"
}
]
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T18:30:00Z",
"end": "2020-12-11T19:31:18Z"
},
"departureSite": "SITE_1",
"arrivalSite": "DEPOT_1",
"distance": 89964,
"nominalDuration": 3678
},
{
"activity": "UNLOADING",
"timeWindow": {
"start": "2020-12-11T19:31:18Z",
"end": "2020-12-11T19:31:18Z"
},
"site": "DEPOT_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_2"
}
]
},
{
"activity": "ROUTE_END",
"timeWindow": {
"start": "2020-12-11T19:31:18Z",
"end": "2020-12-11T19:31:18Z"
},
"site": "DEPOT_1"
}
]
},
{
"id": "NewRoute_2_2",
"activities": [
{
"activity": "ROUTE_START",
"timeWindow": {
"start": "2020-12-11T19:32:18Z",
"end": "2020-12-11T19:32:18Z"
},
"site": "DEPOT_1"
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T19:32:18Z",
"end": "2020-12-11T20:32:31Z"
},
"departureSite": "DEPOT_1",
"arrivalSite": "SITE_1",
"distance": 92784,
"nominalDuration": 3613
},
{
"activity": "WAITING",
"timeWindow": {
"start": "2020-12-11T20:32:31Z",
"end": "2020-12-11T21:00:00Z"
},
"site": "SITE_1"
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T21:00:00Z",
"end": "2020-12-11T21:00:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_5"
}
]
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T21:00:00Z",
"end": "2020-12-11T22:01:18Z"
},
"departureSite": "SITE_1",
"arrivalSite": "DEPOT_1",
"distance": 89964,
"nominalDuration": 3678
},
{
"activity": "UNLOADING",
"timeWindow": {
"start": "2020-12-11T22:01:18Z",
"end": "2020-12-11T22:01:18Z"
},
"site": "DEPOT_1",
"fixedTimeSite": 0,
"volume": 10.0,
"operations": [
{
"id": "OPERATION_5"
}
]
},
{
"activity": "ROUTE_END",
"timeWindow": {
"start": "2020-12-11T22:01:18Z",
"end": "2020-12-11T22:01:18Z"
},
"site": "DEPOT_1"
}
]
}
]
}
],
"rejectOperations": [],
"modifiedData": [
{
"resultingOperation": {
"id": "OPERATION_3",
"type": "COLLECTION"
},
"resultingIdxPassage": 2
},
{
"resultingOperation": {
"id": "OPERATION_4",
"type": "COLLECTION"
},
"resultingIdxPassage": 3
},
{
"resultingOperation": {
"id": "OPERATION_2",
"type": "COLLECTION"
},
"resultingIdxPassage": 1
},
{
"resultingOperation": {
"id": "OPERATION_5",
"type": "COLLECTION"
},
"resultingIdxPassage": 4
}
]
}