A predefined activity limit for a territory ensures that the sum of all its activities is roughly constrained. Since a territory can only have exactly one limit assigned, the entire territory will be limited by this single constraint on the basis of the sum of all its activities. Having multiple limits constraining one and the same territory is therefore not possible. To be able to limit a territory on the basis of all its comprised activities, a limit has to be uniquely assigned to a territory by referring to the unique identifier of the territory.
Typical use cases for the use of limits are territory planning, location assignment and change territories.
Limiting territories 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.
A limit is an optional property within a PTV xTerritory server request that constrains the sum of all activities of exactly one existing territory that is uniquely referenced by this individual limit. The maximumValue
field of a limit is used as total number for allowed activities within the territory that uniquely references the limit.
Limits give more fine-grain control over the calculation process during territory planning, location assignment and change territories by optionally limiting the sum of activities within territories.
Limits constrain the sum of activities of territories (for each territory individually by a unique limit) to fit to individual site conditions or employee experience.
Limits can be set before each calculation step planTerritories()
, distributeLocations()
or changeTerritories()
.
Check if the following prerequisites are fulfilled before you start with one of the supported use cases.
PTV xTerritory server has been installed and the desired map is configured correctly.
A valid license for the individual use case: territory planning, location assignment and/or change territories.
In general, limiting an existing territory's capacity on the basis of its comprised locations' activity values adds fine-grain control not only during location assignment and change territories but also during initial territory planning. The only difference is that with territory planning, limits must not reference any territory because there are no pre-existing territories.
If no limits should be used, the field for the list of limits within a PTV xTerritory server request has to be left out completely - do not hand an empty limits
array to the PTV xTerritory server.
The sum of all user-defined activity limits does not necessarily have to fit the exact sum of all activities. If the sum of limits is less or greater than the total sum of activities, PTV xTerritory server will not try to meet the exact values of the specified limits, but will consider them as weights. Exact limit values are therefore calculated based on the given limit proportions and then used for planning (see planning scenario 2).
In the use case territory planning, user-defined limits must not assign territories since they do not yet exist. If limits carry assignments to non-existing territories, the PTV xTerritory server will not start to plan territories.
The number of user-defined limits must always be equal to the exactNumberOfTerritories
within the planningOptions
of the PTV xTerritory request, otherwise the PTV xTerritory server will not start to plan territories.
In the use case location assignment the number of user-defined limits must be equal to the length of the list of existing territories specified in the request. This means there have to be as many limits as there are territories within the territories
array of a PTV xTerritory request. Every limit needs to be uniquely assigned to an individual existing territory that has not set candidate=true
, so every territory has a unique maximumValue
assignment prior to calculation.
In the use case change territories, independently of increasing/decreasing (with or without candidates) of the number of territories, the number of user-defined limits must always be equal to the exactNumberOfTerritories
within the planningOptions
of the PTV xTerritory request. If this prerequisite is kept, all change scenarios can be calculated with activity limits.
imbalanceTolerance
is considered or check if setting the solutionQuality=HIGH
achieves desired results.
The following examples all relate to the use of AbsoluteActivityLimits
. In order to restrict tour periods, please see the use case "How to estimate tour periods".
In order to carry out a territory planning, location assignment, or territory change with predefined limits, the following is required:
Territory
objects, locations can be assigned/are assigned to (not necessary for territory planning).
AbsoluteActivityLimit
objects as (desired) Territory
objects because every territory has to be limited. Limiting only a subset of territories is not possible.
In order to balance the sum of activity measure per territory, the class AbsoluteActivity
is used. Each Location
object needs to provide an AbsoluteActivity
object because only this type of Activity
works in conjunction with AbsoluteActivityLimits
.
"locations": [ { "id": "location1", "coordinate": { "point": { "x": 6.166279, "y": 49.629301 } }, "activity": { "$type": "AbsoluteActivity", "value": 3.0 } }, { "id": "location2", "coordinate": { "point": { "x": 0.166279, "y": 0.629301 } }, "activity": { "$type": "AbsoluteActivity", "value": 5.0 } } ]
For the use cases location assignment and change territories, each limit has to refer to a specific territory. These territories 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 } } } ]
Within the planningProfile
attribute of a PTV xTerritory server request, set as many AbsoluteActivityLimit
objects into the list of limits
as there are territories to be planned. Make sure that each existing Territory
object is only assigned to exactly one AbsoluteActivityLimit
object within the list of limits. Keep in mind that for the maximumValue
of a territory limit only a value greater 0 is allowed.
"planningProfile": { "limits": [ { "territoryAssignment": "territory1", "$type": "AbsoluteActivityLimit", "maximumValue": 8.0 }, { "territoryAssignment" "territory2", "$type": "AbsoluteActivityLimit", "maximumValue": 8.0 } ] }
distributeLocations
or changeTerritories
){ "locations": [ { "id": "sampleLocation1", "coordinate": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 675000, "y": 6380000 } }, "activity": { "$type": "AbsoluteActivity", "value": 1 } }, { "id": "sampleLocation2", "coordinate": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 675500, "y": 6380500 } }, "activity": { "$type": "AbsoluteActivity", "value": 1 } }, { "id": "sampleLocation3", "coordinate": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 676000, "y": 6381000 } }, "activity": { "$type": "AbsoluteActivity", "value": 1 } }, { "id": "sampleLocation4", "coordinate": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 676500, "y": 6381500 } }, "activity": { "$type": "AbsoluteActivity", "value": 1 } } ], "territories": [ { "id": "sampleTerritory1", "referencePoint": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 676750, "y": 6381550 } } }, { "id": "sampleTerritory2", "referencePoint": { "$type": "Point", "point": { "$type": "PlainPoint", "x": 676250, "y": 6381250 } } } ], "distanceCalculationOptions": { "$type": "ApproximateByDirectDistance" }, "planningProfile": { "limits": [ { "territoryAssignment": "sampleTerritory1", "$type": "AbsoluteActivityLimit", "maximumValue": 8.0 }, { "territoryAssignment": "sampleTerritory2", "$type": "AbsoluteActivityLimit", "maximumValue": 8.0 } ] }, "responseContents": { "territories": true, "locations": true }, "callerContext": null }
The actual limit values that were used for calculation are not returned in the response. Limits were considered correctly if the proportions of all totalActivity
values are equal to the limit proportions specified in the request.
When planning territories, your user-defined limits are considered for the calculation for new, yet non-existing territories. The following sample scenario will help you to understand how territories can be limited right from their initial planning by using exact limit values.
activity
values:
activity = 60.0
activity = 50.0
activity = 30.0
exactNumberOfTerritories = 3
.
exactNumberOfTerritories
) that you want to be considered by the PTV xTerritory server for the three future territories are:
maximumValue = 30.0
maximumValue = 60.0
maximumValue = 50.0
Since the limit values exactly fit the specified activity values, the expected result is that location A
is assigned to territory II
, location B
is assigned to territory III
, and location C
is assigned to territory I
.
In general, the planning result may vary due to the optimization parameters given to the PTV xTerritory server. If the limit values are not met as expected, consider setting the imbalanceTolerance
to a smaller value, or setting the solutionQuality
to HIGH
{ "locations": [ { "id": "sampleLocation1", "coordinate": { "point": { "x": 675000, "y": 6380000 } }, "activity": { "$type": "AbsoluteActivity", "value": 60.0 } }, { "id": "sampleLocation2", "coordinate": { "point": { "x": 675500, "y": 6380500 } }, "activity": { "$type": "AbsoluteActivity", "value": 50.0 } }, { "id": "sampleLocation3", "coordinate": { "point": { "x": 676000, "y": 6381000 } }, "activity": { "$type": "AbsoluteActivity", "value": 30.0 } } ], "distanceCalculationOptions": { "$type": "ApproximateByDirectDistance" }, "planningOptions": { "exactNumberOfTerritories": 3 }, "planningProfile": { "limits": [{ "$type": "AbsoluteActivityLimit", "maximumValue": 30.0 },{ "$type": "AbsoluteActivityLimit", "maximumValue": 60.0 },{ "$type": "AbsoluteActivityLimit", "maximumValue": 50.0 }] } }
When planning territories, your user-defined limits are considered for the calculation for new, yet non-existing territories as weights. The following sample scenario will help you to understand how territories can be limited right from their initial planning by using limit values that are considered as weights.
activity
values:
activity = 60.0
activity = 50.0
activity = 30.0
exactNumberOfTerritories = 3
.
exactNumberOfTerritories
) that you want to be considered by the PTV xTerritory server for the three future territories are:
Since the limit values do not exactly fit the specified activity values, the expected result is not trivial. There could be several valid solutions.
In general, the planning result may vary due to the optimization parameters given to the PTV xTerritory server. If the limit values are not met as expected, consider setting the imbalanceTolerance
to a smaller value, or setting the solutionQuality
to HIGH
{ "locations": [ { "id": "sampleLocation1", "coordinate": { "point": { "x": 675000, "y": 6380000 } }, "activity": { "$type": "AbsoluteActivity", "value": 60.0 } }, { "id": "sampleLocation2", "coordinate": { "point": { "x": 675500, "y": 6380500 } }, "activity": { "$type": "AbsoluteActivity", "value": 50.0 } }, { "id": "sampleLocation3", "coordinate": { "point": { "x": 676000, "y": 6381000 } }, "activity": { "$type": "AbsoluteActivity", "value": 30.0 } } ], "distanceCalculationOptions": { "$type": "ApproximateByDirectDistance" }, "planningOptions": { "exactNumberOfTerritories": 3 }, "planningProfile": { "limits": [{ "$type": "AbsoluteActivityLimit", "maximumValue": 90.0 },{ "$type": "AbsoluteActivityLimit", "maximumValue": 60.0 },{ "$type": "AbsoluteActivityLimit", "maximumValue": 80.0 }] } }
Copyright © 2024 PTV Logistics GmbH All rights reserved. | Imprint