Incompatibilities ensure that certain locations are kept separate to certain territories during the location assignment. A typical use case are sales representative that should not serve certain customers or field worker with specific qualifications.
Incompatibilities can, under certain circumstances, have a major impact on the planning result. It can become impossible to find a valid result. If this occurs, the tolerance threshold may have to be altered.
A property that disqualifies a location for a certain territories.
During the distribution of locations to territories, incompatibilities between locations and territories are taken into account.
Check if the following prerequisites are fulfilled before you start with the use case.
PTV xTerritory server has been installed
High-performance routing network for calculating routes, if applicable.
Adding incompatibilities properties to locations enables you, for example, to depict real customer relationships during the planning process. Inverting the attribution enables you to model qualifications instead of incompatibilities. However, incompatibilities can lead to clear inequalities between territories and can even mean that no valid solution can be found. In such cases, it is advisable to alter the permitted tolerance threshold for different activity totals (PlanningProfile.imbalanceTolerance).
In addition to the digital map of the area which contains the locations, a license is required for the distributeLocations
, in the case of location assignment, as well as for the desired number of territories and locations.
If high-performance routing networks are to be used, a license must also be obtained for these. Furthermore, the path to the Routing Network folder must be placed accordingly in conf/xterritory.properties
.
In order to carry out territory planning or location assignment, the following are required:
locations with incompatibilities
parametrisation for the calculation of stretches of route
Number/territory centres of territories to be planned
Each location to be planned will be represented by an id
and a coordinate
.
Moreover, an activity
must also be given for each location, since the aim of territory planning is to calculate territories such that they are as balanced as possible. For simple activity measures the class AbsoluteActivity
is used, of which the value
contains a double value which is simply totalled for each territory during territory planning.
Territories incompatible a location can be set by the incompatibleTerrritoryIds
attribute in the element LocationProperties). Non existent territory ids will be ignored.
"locations": [ { "id": "location1", "coordinate": { "point": { "x": 6.166279, "y": 49.629301 } }, "activity": { "$type": "AbsoluteActivity", "value": 3.0 }, "properties": { "incompatibleTerrritoryIds": [ "territory1" ] } } ]
Since the location coordinates are in geodecimal format here, the coordinate format must also be specified in the request, in the CallerContext
.
PTV xTerritory server offers several ways to calculate stretches of route:
ApproximateByDirectDistance
)NewDistanceMatrixByRoad
)ExistingDistanceMatrixByRoad
and ApproximateByReferenceMatrix
)The respective option will be chosen according to the DistanceCalculationOptions
subclass that is instantiated.
Example for NewDistanceMatrixByRoad:
"distanceCalculationOptions": { "$type": "NewDistanceMatrixByRoad" }
During territory planning, the precise number of territories to be planned must be specified in the PlanningOptions
.
"planningOptions": { "exactNumberOfTerritories": 2 }
During location assignment, the number of territories is determined by the number of territory centres and must be transferred as a list of territories
.
"territories": [ { "id": "territory1", "referencePoint": { "point": { "x": 6.424008, "y": 49.704545 } } } ]
In the request element ResponseContents
, two types of result lists can be switched on or off. Generally, a list of territories and their assigned locations will be returned. Instead of (or in addition to) this, the parameter locations
lets you switch on a list of locations in the response. The locations in the response are in the same order as in the request and the assigned territory is also shown for every location (Location.territoryId
). A list of locations can be used in a follow-up request, for example, to set fixed assignments of individual locations to particular territories (see use case fixed assignments). Both lists do contain redundant information, but this enables clients to choose the list which is most efficient for them.
If a list of territories is not provided in the response, there is no way of finding the reference points of individual territories for the purpose of territory planning.
"responseContents": { "territories": false, "locations": true }
distributeLocations
)
{ "locations": [ { "id": "location1", "coordinate": { "point": { "x": 6.166279, "y": 49.629301 } }, "activity": { "$type": "AbsoluteActivity", "value": 1.0 }, "properties": { "incompatibleTerrritoryIds": [ "territory1" ] } }, { "id": "location2", "coordinate": { "point": { "x": 6.105082, "y": 49.640585 } }, "activity": { "$type": "AbsoluteActivity", "value": 2.0 }, "properties": { "incompatibleTerrritoryIds": [ "territory2" ] } }, { "id": "location3", "coordinate": { "point": { "x": 6.059420, "y": 49.585083 } }, "activity": { "$type": "AbsoluteActivity", "value": 1.0 }, "properties": { "incompatibleTerrritoryIds": [ "territory1" ] } } ], "territories": [ { "id": "territory1", "referencePoint": { "point": { "x": 6.424008, "y": 49.704545 } } }, { "id": "territory2", "referencePoint": { "point": { "x": 6.096699, "y": 49.845314 } } } ], "distanceCalculationOptions": { "$type": "ApproximateByDirectDistance" }, "responseContents": { "territories": false, "locations": true }, "callerContext": { "properties": [ { "key": "CoordFormat", "value": "OG_GEODECIMAL" } ] } }
Because territories
was set to false
and locations
was set to true
in the ResponseContents
element in the request, a list of locations is included in the response instead of a list of territories. Each location still has a unique identifier in the form of its id
. Assignments to individual territories are made using the territoryId
, which is now set for all locations. The incompatibility of a location to a territory is also displayed the same way in the response as in the request, i.e. via the IncompatibleTerrritoryIds
attribute in the properties
element.
"locations": [ { "id": "location1", "coordinate": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 6.166279, "y": 49.629301 } }, "activity": { "$type": "AbsoluteActivity", "value": 1 }, "properties": { "incompatibleTerrritoryIds": [ "territory1" ] }, "territoryId": "territory2" } ]
If a distance matrix has been calculated or expanded in the request (NewDistanceMatrixByRoad
or ExistingDistanceMatrixByRoad
) a DistanceMatrixSummary
element is included in the response. Among other things, it provides an id
for the distance matrix, which can be entered in the ExistingDistanceMatrixByRoad
element in any further requests, in order to reuse the distance matrix which had just been calculated.
Copyright © 2024 PTV Logistics GmbH All rights reserved. | Imprint