Duration added for first visit on location
In field service routing, technicians often need extra time when visiting a location for the first time in their shift. This overhead can include time to find parking, walk from the vehicle to the property entrance, or set up equipment before starting work.
When a technician visits the same location consecutively (for instance, performing two tasks at the same address), this overhead is only incurred once on the first visit. Subsequent visits at the same location do not need the extra setup time.
1. Use case
A utility company dispatches technicians to perform multiple tasks at apartment buildings. When a technician arrives at a building for the first time, they need to find parking, check in with the building manager, and carry equipment to the correct floor. This overhead typically adds 15 minutes to the first visit. However, if the same technician performs a second task at the same building immediately after, they are already on site and no additional overhead applies.
By configuring durationAddedForFirstVisitOnLocation, the model automatically accounts for this overhead.
The solver is also incentivized to schedule multiple visits at the same location consecutively, because doing so avoids the extra overhead on subsequent visits at the same address.
2. How it works
When durationAddedForFirstVisitOnLocation is set, the model checks whether the location of the current visit differs from the location of the previous stop in the technician’s route (either the shift start location or the previous visit’s location).
-
If the technician is arriving at a new location (different from the previous stop), the overhead duration is added to the visit’s
effectiveServiceDuration. -
If the technician is already at the same location (e.g. the previous visit was at the same address), no extra time is added.
The overhead duration is applied per visit, not per location per day. This means that if a technician leaves a location and returns later in the route, the overhead is applied again on the second arrival.
3. Configuration
The durationAddedForFirstVisitOnLocation can be set at two levels:
-
Global default (on
RoutePlanConfigOverrides): applies to all visits that do not specify their own value. -
Per-visit override (on
Visit): overrides the global default for a specific visit.
3.1. Setting a global default
To apply the overhead to all visits in the plan, set durationAddedForFirstVisitOnLocation in the model configuration:
{
"configuration": {
"modelConfig": {
"overrides": {
"durationAddedForFirstVisitOnLocation": "PT15M"
}
}
},
"modelInput": {
"visits": [
{
"id": "Visit A",
"location": [33.77301, -84.43838],
"serviceDuration": "PT1H"
},
{
"id": "Visit B",
"location": [33.77301, -84.43838],
"serviceDuration": "PT1H"
},
{
"id": "Visit C",
"location": [33.78767, -84.43887],
"serviceDuration": "PT1H"
}
]
}
}
In this example, Visit A and Visit B are at the same location. If the solver assigns them consecutively to the same technician:
-
Visit A (first arrival at the location):
effectiveServiceDuration= 1 hour + 15 minutes = 1 hour 15 minutes. -
Visit B (already at the same location):
effectiveServiceDuration= 1 hour (no overhead added). -
Visit C (different location):
effectiveServiceDuration= 1 hour + 15 minutes = 1 hour 15 minutes.
3.2. Overriding per visit
To use a different overhead duration for a specific visit, or to disable it for a specific visit, set durationAddedForFirstVisitOnLocation directly on the visit:
{
"modelInput": {
"visits": [
{
"id": "Visit A",
"location": [33.77301, -84.43838],
"serviceDuration": "PT1H",
"durationAddedForFirstVisitOnLocation": "PT30M"
},
{
"id": "Visit B",
"location": [33.78767, -84.43887],
"serviceDuration": "PT1H",
"durationAddedForFirstVisitOnLocation": "PT0M"
}
]
}
}
-
Visit A uses a 30-minute overhead, regardless of any global default.
-
Visit B has no overhead (explicitly disabled for this visit).
If a visit does not specify durationAddedForFirstVisitOnLocation and no global default is set, no overhead is applied to that visit.
|
4. Interaction with skill multipliers
The durationAddedForFirstVisitOnLocation duration is added after the skill multiplier is applied to the base serviceDuration.
This means the overhead is always added in full, regardless of the technician’s proficiency.
For example, if a technician has a skill multiplier of 2.0 (working at half speed), and a visit has a serviceDuration of 1 hour with durationAddedForFirstVisitOnLocation of 15 minutes:
-
effectiveServiceDuration= (1 hour × 2.0) + 15 minutes = 2 hours 15 minutes.
5. Interaction with visit groups
When visits are part of a visit group, durationAddedForFirstVisitOnLocation is evaluated independently for each technician’s assigned group member.
Each technician checks whether their preceding stop was at the same location as the group member they are assigned to.
This means:
-
If both technicians arrive at the location for the first time, both get the overhead.
-
If one technician has a preceding visit at the same location, only the other technician gets the overhead.
6. Duration added between sub-locations
Some locations contain several sub-locations that share the same coordinates, such as apartments in one building. When a technician moves from one apartment to another inside the same building, there is no parking overhead, but walking, taking the elevator, or using the stairs still takes time.
To model this internal travel, set subLocationId on each visit, for example the apartment number, and configure durationAddedBetweenSubLocations.
The model adds durationAddedBetweenSubLocations to the visit’s effectiveServiceDuration only when all of the following are true:
-
The previous visit in the technician’s route is at the same location.
-
Both the visit and the previous visit have a
subLocationId. -
The two
subLocationIdvalues are different.
In the following scenarios, the model does not add durationAddedBetweenSubLocations:
-
The technician arrives from a different location (or from the shift start location). Only
durationAddedForFirstVisitOnLocationapplies, even though this is also the first visit at the sub-location. Include the time to reach the sub-location indurationAddedForFirstVisitOnLocation. -
The previous visit is at the same sub-location: the technician is already there.
-
The visit or the previous visit has no
subLocationId: the model cannot tell whether the technician moved.
The two durations never apply to the same visit.
Like durationAddedForFirstVisitOnLocation, durationAddedBetweenSubLocations is applied per visit.
If a technician moves from apartment 101 to apartment 102 and back to apartment 101, both moves get the overhead.
The model uses the value of the visit the technician moves to.
durationAddedBetweenSubLocations can be set as a global default on RoutePlanConfigOverrides and overridden per visit.
Set it to PT0M on a visit to disable it for that visit.
In a visit group, the model evaluates each technician’s previous visit independently, in the same way as durationAddedForFirstVisitOnLocation.
{
"configuration": {
"modelConfig": {
"overrides": {
"durationAddedForFirstVisitOnLocation": "PT15M",
"durationAddedBetweenSubLocations": "PT5M"
}
}
},
"modelInput": {
"visits": [
{
"id": "Visit A",
"location": [33.77301, -84.43838],
"subLocationId": "Apartment 101",
"serviceDuration": "PT1H"
},
{
"id": "Visit B",
"location": [33.77301, -84.43838],
"subLocationId": "Apartment 101",
"serviceDuration": "PT1H"
},
{
"id": "Visit C",
"location": [33.77301, -84.43838],
"subLocationId": "Apartment 102",
"serviceDuration": "PT1H"
}
]
}
}
If the solver assigns these visits consecutively to the same technician, and the technician arrives from a different location:
-
Visit A (first arrival at the building):
effectiveServiceDuration= 1 hour + 15 minutes = 1 hour 15 minutes. OnlydurationAddedForFirstVisitOnLocationapplies. -
Visit B (same apartment):
effectiveServiceDuration= 1 hour. -
Visit C (different apartment in the same building):
effectiveServiceDuration= 1 hour + 5 minutes = 1 hour 5 minutes.