Symptom
A vehicle transports hazardous goods (ADR category B) at the start of a tour and delivers them at one or more stops. The expectation is that route restrictions applied at the beginning of the tour (e.g. tunnel avoidance) would be automatically relaxed after delivery. However, the entire tour continues to apply the same ADR restrictions even after the goods have been delivered.
Cause
In xServer 2, HPR graphs and Distance Matrices are built from a fixed vehicle configuration. This means:
- The vehicle profile (including load and ADR parameters) is defined once at matrix creation time.
- planTours uses this fixed profile for all legs of all tours derived from that matrix.
- There is no mechanism in planTours to dynamically update vehicle properties mid-tour (e.g. after unloading hazardous goods).
This is a fundamental architectural constraint of pre-computed matrix routing and is not a bug.
Resolution
Two approaches are available:
Option 1 – Conservative static profile
Build the HPR and matrix with the most restrictive configuration (all ADR restrictions active). Tours will always be feasible. Some legs after delivery may be slightly sub-optimal (e.g. using a longer route that avoids a tunnel the vehicle could now legally use), but all tours are safe and executable.
Option 2 – planTours + xRoute hybrid
- Run planTours with the restrictive profile to produce an optimized tour sequence.
- Identify legs where the vehicle state changes (after delivery of hazardous goods).
- Recalculate those specific legs using xRoute.
- In the xRoute call, use VehicleParametersAtWaypoint to modify tunnelRestrictionCode at the delivery waypoint.
This provides accurate routing per leg but requires additional API calls after the planTours optimization.
Related articles
PTV xServer 2 :ADR tunnel restrictions not applied in planTours when using ExistingDistanceMatrix
PTV xServer 2: Route divergence after changing vehicle parameters (height, weight)
PTV xServer 2: HPR created successfully via API but does not appear in the HPR list