internal List <Point> GetPath(VisibilityVertex vs, VisibilityVertex vt, bool shrinkDistances) { var pathPoints = new List <Point>(); vs.IsShortestPathTerminal = vt.IsShortestPathTerminal = true; _visGraph.ClearPrevEdgesTable(); var router = new SingleSourceSingleTargetShortestPathOnVisibilityGraph(_visGraph, vs, vt) { LengthMultiplier = 0.8, LengthMultiplierForAStar = 0.3 }; var vpath = router.GetPath(shrinkDistances); if (vpath == null) { Console.WriteLine("seeing a null path"); vs.IsShortestPathTerminal = vt.IsShortestPathTerminal = false; return(pathPoints); } var path = vpath.ToList(); for (int i = 0; i < path.Count(); i++) { pathPoints.Add(path[i].Point); } vs.IsShortestPathTerminal = vt.IsShortestPathTerminal = false; return(pathPoints); }
internal MultipleSourceMultipleTargetsShortestPathOnVisibilityGraph(IEnumerable <VisibilityVertex> sourceVisVertices, IEnumerable <VisibilityVertex> targetVisVertices, VisibilityGraph visibilityGraph) { _visGraph = visibilityGraph; visibilityGraph.ClearPrevEdgesTable(); foreach (var v in visibilityGraph.Vertices()) { v.Distance = Double.PositiveInfinity; } sources = sourceVisVertices; targets = new Set <VisibilityVertex>(targetVisVertices); }