DroidDiagram Programmer's Guide
RoutingOptions.setRouteHeuristics Method
See Also
 






Sets the heuristic function used by the routing algorithm to choose next points in the route.

Namespace: com.mindfusion.diagramming
Package: com.mindfusion.diagramming

 Syntax

Java  Copy Code

public void setRouteHeuristics (
    RouteHeuristics value
)

 Parameters

value

A RouteHeuristics object used to predict the route cost.

 Remarks

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 setRouteHeuristics. So the smaller heuristic value a piece has, the greater the chance the found route to go through that piece.

There are three predefined heuristic functions that can be assigned through setRouteHeuristics: Distance, DistSquare and MaxAbs. All of them assign to pieces heuristic values that are larger for larger distances 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.

 See Also

RoutingOptions Members
RoutingOptions Class
com.mindfusion.diagramming Namespace