Skip to main content

Waiting time management

When time constraints are specified (opening hours of sites, earliest/latest dates on operations, etc.), some waiting activities may be scheduled between deliveries or collections.

In the problem definition, two notions can constrain/clarify these waiting times:

  • are waiting sequences counted in working time?
  • how can we limit these waiting times?

Define a Legislation Profile​

Example of a legislation profile:

  • allowing maximum waiting time of 1 hour
  • considering the waiting sequences are not counted as working time
"legislationProfiles": [
{
"id": "LEGISLATION_1",
"maxWaitingTime": 3600,
"waitingIsWorking": false
}
]
important

If the waitingIsWorking property is not specified in a legislation profile, this means that the waiting time is counted in the working time.

Associate a legislation profile with a vehicle availability period​

"trucks": [
{
"id": "TRUCK_1",
"availablePeriods": [
{
"id": "PERIOD_1",
"timeWindow": {
"start": "2020-12-11T16:31:27.973+01:00",
"end": "2020-12-12T18:30+01:00"
},
"idLegislationProfile": "LEGISLATION_1"
}
]
}
]

The solution​

The solution to this problem shows a waiting activity between the two operations that is not considered as working time

{
"activity": "WAITING",
"timeWindow": {
"start": "2020-12-11T17:00:00Z",
"end": "2020-12-11T17:45:00Z"
},
"site": "SITE_1",
"notWorked": true
}
note

By reducing the maximum waiting time below 45 minutes, the two operations could not be planned on the same route.


Full Problem
{
"sites": [
{
"id": "SITE_1",
"coordinates": {
"latitude": 47.46257,
"longitude": -0.56151
}
},
{
"id": "DEPOT_1",
"coordinates": {
"latitude": 47.20586,
"longitude": -1.56435
},
"isDepot": true
}
],
"legislationProfiles": [
{
"id": "LEGISLATION_1",
"maxWaitingTime": 3600,
"waitingIsWorking": false
}
]
,
"trucks": [
{
"id": "TRUCK_1",
"availablePeriods": [
{
"id": "PERIOD_1",
"timeWindow": {
"start": "2020-12-11T16:31:27.973+01:00",
"end": "2020-12-12T18:30+01:00"
},
"idLegislationProfile": "LEGISLATION_1"
}
]
}
]
,
"operations": [
{
"id": "OPERATION_1",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"earliestLatestDatesOnOrigin": {
"start": "2020-12-11T18:00+01:00",
"end": "2020-12-11T18:00+01:00"
}
},
{
"id": "OPERATION_2",
"type": "COLLECTION",
"idSiteOrigin": "SITE_1",
"earliestLatestDatesOnOrigin": {
"start": "2020-12-11T18:45+01:00",
"end": "2020-12-11T18:45+01:00"
}
}
]
}
Full Solution
{
"vehicleRoutes": [
{
"truck": "TRUCK_1",
"period": "PERIOD_1",
"routes": [
{
"id": "NewRoute_1_1",
"activities": [
{
"activity": "ROUTE_START",
"timeWindow": {
"start": "2020-12-11T17:00:00Z",
"end": "2020-12-11T17:00:00Z"
},
"site": "SITE_1"
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T17:00:00Z",
"end": "2020-12-11T17:00:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"operations": [
{
"id": "OPERATION_1"
}
]
},
{
"activity": "WAITING",
"timeWindow": {
"start": "2020-12-11T17:00:00Z",
"end": "2020-12-11T17:45:00Z"
},
"site": "SITE_1",
"notWorked": true
},
{
"activity": "COLLECTION",
"timeWindow": {
"start": "2020-12-11T17:45:00Z",
"end": "2020-12-11T17:45:00Z"
},
"site": "SITE_1",
"fixedTimeSite": 0,
"operations": [
{
"id": "OPERATION_2"
}
]
},
{
"activity": "DRIVING",
"timeWindow": {
"start": "2020-12-11T17:45:00Z",
"end": "2020-12-11T18:46:18Z"
},
"departureSite": "SITE_1",
"arrivalSite": "DEPOT_1",
"distance": 89964,
"nominalDuration": 3678
},
{
"activity": "UNLOADING",
"timeWindow": {
"start": "2020-12-11T18:46:18Z",
"end": "2020-12-11T18:46:18Z"
},
"site": "DEPOT_1",
"fixedTimeSite": 0,
"operations": [
{
"id": "OPERATION_2"
},
{
"id": "OPERATION_1"
}
]
},
{
"activity": "ROUTE_END",
"timeWindow": {
"start": "2020-12-11T18:46:18Z",
"end": "2020-12-11T18:46:18Z"
},
"site": "DEPOT_1"
}
]
}
]
}
],
"rejectOperations": [],
"modifiedData": []
}