RouteDyn

Top  Previous  Next

Function RouteDyn(link1,link2: integer; percent1,percent2: double; var fromto1,fromto2,routelength: integer; var extra: single): single;

 

This function is used for dynamic routing. This means a route can be calculated from somewhere along a link to somewhere along another link. The normal Route function always goes from node to node.

 

Link1 and percent1 denotes where on link1 the route should start. The percentage (0 < percent1 < 1) counts from the same end as the link has been digitized.

 

Link2 and percent2 is the same, just for the link, where the route ends.

 

Fromto1 is part of the result. If fromto1=0, the calculated route goes through the start node of link1. If fromto1=1, the calculated route goes through the end node of link1.

 

Fromto2 has the same meaning, just for link2.

 

Routelength holds the number of nodes in the calculated route. If routelength=0, the route is a subset of link1. This can only happen if link1=link2, that is if the routing is along the same link. Even when link1=link2, routelength can also be >0.

 

You should never call function RouteFind after RouteDyn as this is an integrated part of RouteDyn. However RouteGetLink, RouteGetNode etc. can be called the normal way.

 

Variable extra hold the extra cost, if ExtraVarCreate has been called.

 

The result holds the cost of the route.

 

There are a few restrictions when using loop links, that is links which start and end at the same node:

Loop links can not hold one-way information.

When computing a route where link1=link2 and the link is also a loop link, turn restrictions are not considered.

 

It is advisable to split loop links in the network in 2 sections, this removes the restrictions mentioned above.

 

Use OnRouteProgress event to track progress in very large networks. In small / medium sized networks it is not needed.

 

Possible error codes: -10 -30 -33 -43

Versions: Standard Pro

ActiveX / VCL / CLX component: RWcalc