Use Cases > Cluster Planning > How to use the tour period estimation

How to use the tour period estimation

The PTV xTerritory server allows you to plan and change territories and territory centres based on locations such as, for example, customer addresses, or based on smaller administrative area units such as postcode areas. With the PTV xTerritory server's tour period estimation, also time estimates for tour periods can be calculated. A common use case for the tour period estimation is in planning and management of sales representatives who travel from customer location to customer location to provide service.

Terminology

Tour Period, Service Tour Period

A Tour Period is a time estimate in seconds of a service tour of for example a service employee who travels from location to location within a territory. The tour period is always calculated for exactly one territory. It is the sum of all service periods (see Service Period or activity values) at each location and all driving periods (see Driving Period) between locations this service employee passes through while providing service to customers in a territory.

Service Period

A Service Period is the activity value of a location interpreted as time (in seconds) spent for providing service by an employee at a particular location.

Driving Period

A Driving Period is the server calculated time from one location to another within a territory. It is estimated by the average distance to a location's nearest neighbouring locations. The number of nearest locations can be configured in the PTV xTerritory's profile file (default.xml, see also the PTV xTerritory profile documentation).

Estimated Driving Time To Territory

The estimated driving time from a territory's centre to the territory itself is the average distance to the territory centre's nearest five locations. The estimated driving time to a territory cannot be configured and is not considered when a service period is calculated for a territory. It is however returned by the PTV xTerritory server in all uses cases except in the use case planTerritories.

xTerritory Tour Estimation Illustrates the basic terminology for tour estimation.
xTerritory Tour Estimation Illustrates further terminology for tour estimation.

Benefits

Prerequisites

Check if the following prerequisites are fulfilled before you start with one of the supported use cases.

Concept

Estimating tour periods for territories is a concept by which activity values of locations are interpreted as service periods, e.g. working hours of a service employee, and driving periods between locations are summed up. This sum then represents an estimated round trip time for a tour through all locations of a territory. This concept provides the basic mechanism for planning, distributing and changing territories according to a tour estimate. It can be regarded as a prior step for a more fine-grained tour calculation by the PTV xTour server with many more parameters. In general, for an estimate of a round trip tour period within a territory, service times and driving times are the only time contributions that are considered. The driving period from a territory centre to the territory itself is not considered by the PTV xTerritory's tour estimation. Nonetheless, this particular driving time is provided within the territory summary as additional value.

It is also possible to set limits with the PTV xTerritory server for each territory and all three use cases: territory planning, location assignment and change territories. If limits should be applied, the limit class TourPeriodLimit must be set to constrain the tour period estimation by a single value per territory (maximumDuration). A territory's estimated tour period then must not exceed this maximumDuration. A typical maximumDuration for a service tour period in a territory could be the maximum amount of eight working hours a day.

When limiting tour periods, TourPeriodLimit must not be mixed with AbsoluteActivityLimits.

Limiting the duration of a tour period for a territory can have a major impact on the calculation results in all use cases. However, when limits are applied, it can become impossible to find a valid calculation result. If this occurs, more reasonable values for the limits themselves or other planning parameters within the planningProfile need to be considered.

For further information on how to use activity limits (or tour period limits) see the use case How to distribute locations with predefined limits.

Programming Guide

In order to balance tour periods instead of absolute activity sums, the following is required:

When using tour estimation, AbsoluteActivities must not be mixed with ServicePeriodActivities.

Set locations with ServicePeriodActivities

When balancing tour periods per territory, a location's activity is interpreted as service period in seconds. Therefore, the class ServicePeriodActivity has to be set for each location.

"locations": [
  {
    "id": "location1",
    "coordinate": {
      "point": {
        "x": 6.166279,
        "y": 49.629301
      }
    },
    "activity": {
      "$type": "ServicePeriodActivity",
      "period": 100
    }
  },
  {
    "id": "location2",
    "coordinate": {
      "point": {
        "x": 0.166279,
        "y": 0.629301
      }
    },
    "activity": {
      "$type": "ServicePeriodActivity",
      "period": 100
    }
  }
]
Set existing territories that should be limited (not relevant for territory planning)

If territories already exist and should be used to assign locations to them, they need to be set within the request to the PTV xTerritory server as well.

"territories": [
  {
    "id": "territory1",
    "referencePoint": {
      "point": {
        "x": 6.424008,
        "y": 49.704545
      }
    }
  },
  {
    "id": "territory2",
    "referencePoint": {
      "point": {
        "x": 12.848016,
        "y": 49.704545
      }
    }
  }
]

 

Response interpretation

The response with estimated tour periods for each territory is very similar to use cases where AbsoluteActivity was used. The main difference is that driving periods from location to location are also taken into account for the estimated tour period in each territory. Therefore, the totalActivity of each territory does not represent the sum of each location's activity but the sum of all service periods added to the sum of all driving periods in this territory. The estimatedTravelTimeToTerritory can be obtained from the TerritorySummary in the PTV xTerritory server's response.