Gets a heuristic delegate function that returns the real distance sqrt(dx^2 + dy^2) between two pieces of the routing grid.
Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming
C# Copy Code |
---|
public static RouteHeuristics Distance { get; } |
Visual Basic Copy Code |
---|
Public Shared ReadOnly Property Distance As RouteHeuristics |
A predefined RouteHeuristics delegate instance.
While generating a path, the routing algorithm evaluates pieces of the routing grid adjacent to the current one. It takes into account the cost for passing trough a piece and adds to that cost a heuristic value calculated by a RouteHeuristics delegate. So the smaller heuristic value a piece has, the greater the chance the found route to go through that piece.
Distance is a predefined delegate that assigns to pieces a heuristic value equaling the piece distance to the target. Thus of the four pieces adjacent to the current one, the piece closest to the target has the smallest value and the route generation continues through it. Distance is the default value of the RouteHeuristics property.
The following sample demonstrates how to use this property:
C# Copy Code |
---|
diagram.RoutingOptions.RouteHeuristics = RoutingOptions.Distance; |
Visual Basic Copy Code |
---|
Diagram.RoutingOptions.RouteHeuristics = RoutingOptions.Distance |