Resource Recommendation Travel Time Calculation
To support configuration and troubleshooting, it can be helpful to understand the Resource location determination and calculation rules for the travel times shown in Resource recommendations.
Location Determination Rules
For Appointments and Events, locations used to calculate travel times are determined based on the following prioritized rules.
1. If Appointments or Events scheduled between the current time and the preferred start time during the same work shift segment for a Resource have valid locations, the location of the previous Event or Appointment closest to the preferred start time for the Job is used.
2. Otherwise, current location data for the Resource is used if valid and reported within the configured Resource Location Lifespan value. If not, and PubNub is configured to provide current Resource location data for recommendations, location data from PubNub is used. If PubNub is not configured to provide Resource location data, and the current Resource location is valid and within the configured Resource Location Lifespan value based on the Job's preferred start time, current Resource location data is used.
3. Otherwise, if Appointments or Events are scheduled within the same shift work segments as the relevant preferred start times and have valid locations, and end times are before the current time, the previous Appointment or Event location values are used.
4. Otherwise, if relevant Resources have default location values, those locations are used.
5. Otherwise, if no default locations are set for relevant Resources, or routes cannot be driven (for example, because an ocean crossing is required), no travel times are calculated, and location unavailable appears on Resource Cards.
Resource determination information appears on Resource Cards based on the rule applied.
Rule
Label
Description
1
From Previous Appointment
Resource location data used was based on the previous Appointment location.
2
<N> minutes ago
Number of minutes since Resource location data was refreshed.
Just now
Resource location data used was refreshed less than 5 minutes before the current time.
3
From Previous Appointment
Resource location data used was based on the previous Appointment location.
4
From Default Location
Default Resource location data used.
5
Location unavailable
No Resource location data available.
6
Resource off duty
Preferred start time is outside the working hours for the Resource.
* 
In cases where preferred start times for Jobs are in the past or are unspecified, the current time is used as the preferred start time.
To determine Resource availability, time zones for the associated effective shift plans are used, which may not match the currently selected time zone.
If no shift is defined for a Resource, the entire 24-hour day is used as the work shift segment. 24-hour days are based on the default time zones defined at the user level if available. Otherwise the time zone defaults to the active System Setting record. If no time zone is defined at the system level, the server time zone is used. Otherwise, the time zone defaults to UTC. For more information, see Working With Shifts.
For example, in a situation where the Resource Location Lifespan value is set to 180 minutes (so that location information is valid for 3 hours), the assigned technician's working shift segment is 9:00 to 17:00, the preferred start time is 12:00, and the current time is 10:30:
If the technician is assigned to an Appointment with a valid location from 9:00 to 11:00, rule 1 is applied, and the location of that Appointment is used to calculate travel time to the 12:00 Appointment.
If the technician is assigned to an Appointment from 9:00 to 10:00, and the current Resource location was reported at 10:00, rule 2 is applied, and the current (valid) location is used.
If the technician is assigned to an Appointment with a valid location from 9:00 to 10:00, and the current (now invalid) Resource location was last reported at 8:00, rule 3 is applied, and location data for the 9:00 Appointment is used.
If no Appointment are assigned to the technician during the relevant shift segment previous to the 12:00 Appointment and the current (now invalid) Resource location was last reported at 8:00, rule 4 is applied, and the default Resource location is used.
If no Appointments are assigned to the technician during the relevant shift segment previous to the 12:00 Appointment, the current (now invalid) Resource location was last reported at 8:00, and no default Resource location is set, rule 5 is applied, and location unavailable appears on Resource Cards.
* 
If PubNub is configured as the Resource location data provider, calls to the service to retrieve current data are made only in the following cases:
Current Resource locations are invalid or not reported within the configured Resource Location Lifespan value.
No Appointments or Events are assigned to Resources between the current time and the preferred start time for Jobs.
The current time is later than the preferred start time for a Job minus the number of minutes configured in the associated Resource Location Lifespan value.
Travel Time Scoring
Scoring for Resource recommendations with travel time is achieved as follows:
1. Resource travel times are scaled proportionally based on the value specified in the Maximum Travel Time for Resource Recommendation setting as follows:
1 − (Resource travel time)/(Maximum Travel Time for Resource Recommendation setting value), for example, 1 − 50/300.
After scaling, each Resource score is a value between 0 and 1, with longer travel times receiving smaller values.
2. To calculate travel time scores, each Resource's scaled score is then multiplied by the value defined in the Relative Importance field of the Resource Travel Time credential category.
3. Travel time scores are rounded down to one decimal to arrive at final values, as follows:
round( (1 − (Resource travel time)/(Maximum Travel Time for Resource Recommendation setting value)) × Relative Importance field value), for example, (1 − 50/300) × 3 ≈ 2.5.
Each Resource travel time score is added into the overall recommendation score, so that the total score is the sum of the Resource recommendation score plus the relevant travel time score.
* 
Resources with travel times that exceed the specified Maximum Travel Time for Resource Recommendation setting value receive a 0 score.
In cases where the specified Maximum Travel Time for Resource Recommendation setting value is 0, maximum travel times for recommended Resources are used as maximum setting values during calculation.
Resources with travel times that are close or equal to but not larger than the specified maximum values can sometimes receive 0 scores after rounding. A mimimum 0.1 score is set to distinguish these Resources from others with travel times that exceed the maximum setting.
Maximum Resource travel time scores are used as the base score of the Resource Travel Time credential category in percentage scoring calculations.
Example
In this example, the Relative Importance value of the Resource Travel Time credential category is set to 3, the specified Maximum Travel Time for Resource Recommendation setting value is 300 minutes, and 5 Resources are recommended with the following travel times:
Andrea: 50 minutes
Bob: 90 minutes
Catherine: 296 minutes
David: 300 minutes
Ellen: 310 minutes
Travel time scaling produces the following values:
Andrea: (1 − 50/300) = 0.8333333333333334
Bob: (1 − 9/300) = 0.7
Catherine: (1 − 296/300) = 0.013333333333333308
David: (1 − 300/300) = 0
Ellen: Score is not scaled and set to 0.
When these ranking scores are multiplied by the configured Relative Importance value, scores are as follows:
Andrea: 0.8333333333333334 × 3 = 2.5
Bob: 0.7 × 3 = 2.1
Catherine: 0.013333333333333308 × 3 = 0.039999999999999925
David: 0 × 3 = 0
Ellen: Final score of 0 already applied.
After rounding, final scores are:
Andrea: round(2.5) = 2.5
Bob: round(2.1) = 2.1
Catherine: round(0.039999999999999925) = 0, therefore final score is set to 0.1
David: round(0) = 0.1
Ellen: Final score of 0 already applied
* 
Resource travel time score is set to 0 and location unavailable appears on Resource Cards when travel times cannot be retrieved either because valid location data is unavailable for Resources, the system failed to retrieve travel times from the configured map provider, or Resources are off duty.
Map provider query limitations can cause travel times to be unavailable. For MapBox, the limit is 2,000 requests per minute and a maximum of 10,000 kilometers between all waypoints. For Google, the limit is 50 requests per second, and a maximum of 100,000 requests per day are shared with all APIs. When travel time cannot be retrieved due to map provider query limitations, there is no retry, and recommendation scores are set to 0. When you use Recommend Resources, if travel time data cannot be retrieved for at least one Resource, persistent notification warnings appear.
When users attempt to generate Resource recommendations for Resource Lists that have more entries than the configured Maximum Resource List for Resource Recommendation value, no recommendations are made, and the following error appears: Failed to get travel time for some resource(s). You might want to reduce the resources in the resource list or try again later.
For more information:
Was this helpful?