Top  Previous  Next

This method calculates alternative routes between 2 locations.


It works this way:

First route is calculated the normal way.

Now, all links making up the first route are made x % more "expensive", so they are less likely to be chosen when next route is calculated.

Second route is calculated, which may include parts of the first route.

Now even more links gets marked.

Third route etc.


If NumOfRoutes=0, it stops when new routes equal one of those already calculated.

Otherwise it may stop sooner.


TimeIndex points to the timeArray which is used if you want fastest route calculation.

Set TimeIndex = -1, if you want shortest route.


SmallDeviationFactor makes sure that routes almost equal do not get generated. Default value of 0.1 = 10% seems good.


Factor is the amount of percentage already used links should be made more expensive. 1.3 to 1.4 seems good values. 1.3 equals x = 30%.


TmpCostIndex is the costArray, which is used for temporary route calculations.

Call SetCheapest before calling AltRouteDyn.


ARL should be created in advance and contains the output.


Syntax: AltRouteDyn(loc1, loc2: TLocation; TimeIndex, TmpCostIndex, NumRoutes: integer; SmallDeviationsFactor, Factor: double; ARL: TAltRouteList)