Best Practices : (effective) profile - (xServer 1)

Deals with generic topics such as logging, framework and so on. If you are not sure where to place your topic just put it here.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Best Practices : (effective) profile - (xServer 1)

Post by Bernd Welter »

Hello together,

in the recent weeks several contacts asked me the same question about routing parameters and
I think this is a good opportunity to provide the answer in public. The question was more or less
We want to create our own routing profiles but we are not sure about how to set the large
number of profile parameters. So what are the parameters we should take a look at?
Before I start to answer the question in detail let me just draw your attention to some
basic principles of profiles (btw they are also documented here in the Technical Concepts section of the manual.
  • Working with profiles is a generic topic - it is not only working with xRoute but also with xTour, xDima, ...
  • Besides the concrete values in the routing parametrization you should enable yourself to understand
    the data flow of parametrizing: some of you might be interested in server side XML profiles
    (CallerContextKey="Profile") while others may prefer to generate the profiles on the fly
    (CallerContextKey="ProfileXMLSnippet").
    And there is a hierarchy between the approaches (applying to each routing parameter)
    • ProfileXMLSnippet beats Profile
    • Profile beats parent profile
    • parent profile beats default profile
    It is up to you to decide which parameter should be taken from which level.
From my personal experience most customers deal with the following major (logical) categories of routing parameters:
  • SpeedValues: a car and a truck have different speed values o course. These values are defined in Profile/Routing/Vehicle/Speed.
  • AvoidBehaviour: describe the preferences and dislike behaviour for various street categories (highways, tollroads, urban...).
  • ...
  • LinkType and distance, levelling: those values refer to specific conditions reflecting the street
    network you are dealing with. For most users these values should remain untouched until you really
    face an issue related to them (e.g. customers working in areas where closest highways are far away)
Well, writing this abstract I recognize that I can hardly recommend a specific setting which satisfies any players requirements.

I therefore decided to attach a so-caled effective profile (check end of posting) which contains almost every parameter we use (1.20.1, Feature Layers excluded) and I advise to proceed as follows:
  • Try to categorize the keys that match YOUR requirements "textmark" them green.
  • Separate the others and mark them as "maybe to be used later" and "shouldn't be touched"
  • Furthermore you should create a structured hierarchy which reflects your own fleet, e.g.
    a base profile that contains values that are equal for all your vehicles and those who differ.
  • Create derived child profiles that contain the values you'd like to be individual.
Best regards Bernd

PS: this is a complicated topic - feel free to give me some feedback about this!

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Profile>
	<Common coordinateFormat="OG_GEODECIMAL" language="en" majorVersion="1" minorVersion="0"/>
	<Routing majorVersion="2" minorVersion="0">
		<Waypoint linkType="ROAD" maximumDistanceToCombinedTransport="100" maximumDistanceToSegment="1000">
			<LinkTypeConfiguration>
				<Road headingTolerance="360" maximumDistanceForNetworkClass0="1000" maximumNetworkClass="7" minimumNetworkClass="0" onlyReachableRoads="true"/>
				<Smart checkNetworkClassOnlyForVias="true" maximumDistanceToMainNode="100" maximumDistanceToMainNodeForNetworkClass0="1500"/>
				<TollStation maximumDistance="1000"/>
				<RoadName maximumDistance="3000" maximumDistanceToMainNode="2000"/>
			</LinkTypeConfiguration>
		</Waypoint>
		<Algorithm aStarAggressiveness="1.3" routingAlgorithm="BIDIRECTIONAL_KSTAR">
			<LevellingScopeByNetworkClass searchSpace="-1"/>
			<LevellingScopeByNetworkClass searchSpace="-1"/>
			<LevellingScopeByNetworkClass searchSpace="-1"/>
			<LevellingScopeByNetworkClass searchSpace="200"/>
			<LevellingScopeByNetworkClass searchSpace="20"/>
			<LevellingScopeByNetworkClass searchSpace="10"/>
			<LevellingScopeByNetworkClass searchSpace="10"/>
			<LevellingScopeByNetworkClass searchSpace="10"/>
			<GeographicRestrictions>
				<BoundingBox boundingBoxExtension="0" restrictionMode="NONE">
					<CustomBoundingBox bottom="-89.999" left="-180" right="180" top="90"/>
				</BoundingBox>
			</GeographicRestrictions>
		</Algorithm>
		<Course distanceTimeWeighting="80" enforceShortestRoute="false">
			<BasicDataRules>
				<VehicleSpecific>
					<AuthorizedVehicles turningBanCost="0"/>
					<DeliveryVehicles segmentMalus="2501"/>
					<EmergencyVehicles segmentMalus="2501" turningBanCost="0"/>
					<ProjectSpecificVehicles blockedSegmentMalus="2501" openSegmentMalus="0" turningBanCost="0"/>
				</VehicleSpecific>
				<Blockings blockedInWinterMalus="0" blockedMalus="2501" blockedTimeDependentMalus="0" oppositeDirectionInOneWayRoadMalus="2501"/>
				<Network rampMalus="10">
					<MalusByNetworkClass malus="0"/>
					<MalusByNetworkClass malus="0"/>
					<MalusByNetworkClass malus="0"/>
					<MalusByNetworkClass malus="0"/>
					<MalusByNetworkClass malus="15"/>
					<MalusByNetworkClass malus="50"/>
					<MalusByNetworkClass malus="100"/>
					<MalusByNetworkClass malus="100"/>
				</Network>
				<Toll extraTollMalus="0" tollMalus="0" vignetteMalus="0"/>
				<SpecialAreas forbiddenLowEmissionZoneMalus="2500" minimumUrbanNetworkClass="2" residentialMalus="2500" urbanMalus="0"/>
				<CombinedTransport ferryMalus="100" piggybackMalus="100"/>
			</BasicDataRules>
			<AdditionalDataRules enabled="false" layerName="">
				<SegmentSpecific useBlockedForCarsAttribute="true" useBlockedForTrucksAttribute="true" useFerryDuration="true" useFerryLength="true" useRampAttribute="true" useSegmentLength="true" useSpeed="true" useTollForCarsAttribute="true" useTollForTrucksAttribute="true" useUrbanAttribute="true"/>
				<VehicleSpecific enabled="false">
					<Malus combustibles="0" delivery="0" hazardousGoods="0" hazardousToWaters="0" maintenanceTrucks="0" preferredForHazardousGoods="0" preferredForTrucks="0" residential="0" restrictedTunnel="0" vehiclesWithTrailer="0"/>
				</VehicleSpecific>
			</AdditionalDataRules>
			<DynamicRouting breakCalculationPrecision="4294967295" dynamicTimeOnStaticRoute="false" layerName="" limitDynamicSpeedToStaticSpeed="true" useFreeFlowSpeed="false" useLegacyDynamic="false">
				<SpeedMapping baseSpeed="1" mappedSpeed="1"/>
				<SpeedMapping baseSpeed="10" mappedSpeed="10"/>
				<SpeedMapping baseSpeed="20" mappedSpeed="20"/>
				<SpeedMapping baseSpeed="30" mappedSpeed="30"/>
				<SpeedMapping baseSpeed="40" mappedSpeed="40"/>
				<SpeedMapping baseSpeed="50" mappedSpeed="50"/>
				<SpeedMapping baseSpeed="60" mappedSpeed="56"/>
				<SpeedMapping baseSpeed="70" mappedSpeed="61"/>
				<SpeedMapping baseSpeed="80" mappedSpeed="66"/>
				<SpeedMapping baseSpeed="90" mappedSpeed="69"/>
				<SpeedMapping baseSpeed="100" mappedSpeed="72"/>
				<SpeedMapping baseSpeed="110" mappedSpeed="73"/>
				<SpeedMapping baseSpeed="120" mappedSpeed="74"/>
				<SpeedMapping baseSpeed="130" mappedSpeed="75"/>
				<SpeedMapping baseSpeed="140" mappedSpeed="75"/>
				<DynamicTimeStep count="1" size="900"/>
			</DynamicRouting>
			<Maneuver considerTurningBans="true" uTurnCost="5000"/>
			<Violations>
				<SegmentBlockingViolations cost="50000" enabled="false"/>
			</Violations>
		</Course>
		<Vehicle>
			<Physical>
				<Drive driveType="MOTORIZED">
					<Emissions emissionClass="EURO_5" emissionTechnology="EXHAUST_GAS_RECIRCULATION" lowEmissionZoneType="GREEN" particleFilterInstalled="false" particleReductionClass="0"/>
					<Engine bioFuelRatio="0" cylinderCapacity="3000" fuelConsumption="30" fuelType="DIESEL"/>
				</Drive>
				<Weight emptyWeight="7500" loadWeight="0" totalPermittedWeight="15000"/>
				<Axle axleLoad="0" numberOfAxles="3"/>
				<Trailer emptyWeight="0"/>
				<Passenger maximumPermittedNumberOfPassengers="1"/>
				<Dimension height="250" heightAboveFrontAxle="80" length="1200" width="220"/>
			</Physical>
			<Legal yearOfManufacture="2005">
				<LegalCondition isAuthorized="false" isDelivery="false" isEmergency="false" isMaintenance="false" isProject="false"/>
			</Legal>
			<Load hazardousGoodsType="NONE" loadType="GOODS" tunnelRestrictionCode="NONE"/>
			<Speed maximumSpeed="255" speedForAirLineDistance="36">
				<SpeedRangeByNetworkClass maximumSpeed="80" minimumSpeed="55"/>
				<SpeedRangeByNetworkClass maximumSpeed="65" minimumSpeed="30"/>
				<SpeedRangeByNetworkClass maximumSpeed="55" minimumSpeed="23"/>
				<SpeedRangeByNetworkClass maximumSpeed="45" minimumSpeed="20"/>
				<SpeedRangeByNetworkClass maximumSpeed="40" minimumSpeed="18"/>
				<SpeedRangeByNetworkClass maximumSpeed="30" minimumSpeed="15"/>
				<SpeedRangeByNetworkClass maximumSpeed="12" minimumSpeed="7"/>
				<SpeedRangeByNetworkClass maximumSpeed="6" minimumSpeed="4"/>
			</Speed>
		</Vehicle>
		<Matrix distanceLimit="4294967295" onlyTollRoads="false" timeLimit="4294967295">
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
			<SumUpNetworkClass sumUp="true"/>
		</Matrix>
		<Isochrone polygonCalculationMode="TILE_BASED" useLevelling="false">
			<TileBasedPolygon smoothingLength="1"/>
		</Isochrone>
		<RouteList>
			<Maneuvers detailLevel="STANDARD" maneuversAtStartAndDestination="false">
				<Bridges maneuvers="true" maximumDistanceBehind="1000" minimumLength="1000"/>
				<Tunnels maneuvers="true" maximumDistanceBehind="1000" minimumLength="1000"/>
				<Start detailLevel="ALL" radius="0"/>
				<Destination detailLevel="ALL" radius="0"/>
				<Urban information="true" maneuvers="true" minimumDistanceForManeuvers="1000" minimumNetworkClassForInformation="2"/>
			</Maneuvers>
			<ManeuverGroups maximumDistanceBetweenManeuvers="500" maximumNumberOfManeuvers="2147483647">
				<BoundingBox aspectRatio="1" calculateBoundingBoxes="true" offset="1443"/>
			</ManeuverGroups>
		</RouteList>
		<AdditionalRules maximumAirLineDistance="4294967295">
			<ExceptionPaths>
				<Polyline insertExtraPoints="false" maximumDistanceBetweenPolypoints="80"/>
				<Binary validate="true"/>
			</ExceptionPaths>
			<Elevations maximumNumberOfInterpolationPoints="3" minimumSmoothingInclination="5" smoothing="false" useBorderTilesForInterpolation="false"/>
		</AdditionalRules>
	</Routing>
	<FeatureLayer majorVersion="1" minorVersion="0">
		<GlobalSettings enableTimeDependency="false" enableVehicleDependency="true"/>
	</FeatureLayer>
	<BreakAndRestRules considerOnlyDrivingAsWorkingHours="true" majorVersion="1" minorVersion="0">
		<BreakRules enabled="true" maximumDrivingTimeBeforeBreak="16200" minimumDurationOfAdditionalBreaks="1800" minimumDurationOfFirstBreak="900" totalBreakPeriod="2700"/>
		<RestRules durationOfShift="39600" enabled="true" maximumWorkingHoursDuringShift="32400" minimumStayAtStopForRest="10800" restPeriod="39600"/>
	</BreakAndRestRules>
</Profile>
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Re: Best Practices : (effective) profile

Post by KZsolt »

Hello everyone!

Thanks for your ideas Bernd!
I have a slightly different question in connection to the profile structuring you mentioned in the previous post:
Currently I’m trying to abrogate the RoutingParameters we use during xRoute planning, while keeping the current planning behaviour with the usage of profiles only. Saddly I can’t find detailed informations about the corresponding profile parameters for some RoutingParameter.
Is there any guide that I can use to set the correct profile settings which currently overriden by the RoutingParameters?

Thanks for any information you can share :)

Regards,
Zsolt
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Best Practices : (effective) profile

Post by Bernd Welter »

Hello Zsolt,

how about this link:
http://xserver.ptvgroup.com/fileadmin/f ... s%7C_____0

In the section
technical concepts => about profiles => PTV xServer bunndle => .... we describe the various elements that create the XML profile

For example the entry point for the routing profile could be:
http://xserver.ptvgroup.com/fileadmin/f ... g%7C_____0

Unfortunately there is no generic document which describes the link between the RoutingOptions and the corresponding Profile-Node.

Best regards Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Re: Best Practices : (effective) profile

Post by KZsolt »

Helo!

Yeah I've found those documents, but unfortunately these can't really answer questions like:
"How am I suppose to set profile parameters to achieve the same results that I currently get with a <RoutingOption Parameter="OPTIMIZATION" Value="40" /> parameter" right?

Regards,
Zsolt
User avatar
Bernd Welter
Site Admin
Posts: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Best Practices : (effective) profile

Post by Bernd Welter »

ok, thats tricky... so you need the matching...
Hm...

RoutingOption.OPTIMIZATION corresponds with Routing / Course / @distanceTimeWeighting

I'm afraid we will have to collect those options now one by one :o

Regards Bernd
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
KZsolt
Posts: 51
Joined: Fri Oct 03, 2014 1:19 pm

Re: Best Practices : (effective) profile

Post by KZsolt »

Hello!

Yeah that would be great :D!

Regards,
Zsolt
Post Reply