private bool InitPath(VertexEntry[] sourceVertexEntries, VisibilityVertexRectilinear source, VisibilityVertexRectilinear target) { if ((source == target) || !InitEntryDirectionsAtTarget(target)) { return(false); } this.Target = target; this.Source = source; double cost = this.TotalCostFromSourceToVertex(0, 0) + HeuristicDistanceFromVertexToTarget(source.Point, Directions.None); if (cost >= this.upperBoundOnCost) { return(false); } // This path starts lower than upperBoundOnCost, so create our structures and process it. this.queue = new GenericBinaryHeapPriorityQueueWithTimestamp <VertexEntry>(); this.visitedVertices = new List <VisibilityVertexRectilinear> { source }; if (sourceVertexEntries == null) { EnqueueInitialVerticesFromSource(cost); } else { EnqueueInitialVerticesFromSourceEntries(sourceVertexEntries); } return(this.queue.Count > 0); }
private void Cleanup() { foreach (var v in this.visitedVertices) { v.RemoveVertexEntries(); } this.visitedVertices.Clear(); this.queue = null; this.TestClearIterations(); }
private bool InitPath(VertexEntry[] sourceVertexEntries, VisibilityVertexRectilinear source, VisibilityVertexRectilinear target) { if ((source == target) || !InitEntryDirectionsAtTarget(target)) { return false; } this.Target = target; this.Source = source; double cost = this.TotalCostFromSourceToVertex(0, 0) + HeuristicDistanceFromVertexToTarget(source.Point, Directions. None); if (cost >= this.upperBoundOnCost) { return false; } // This path starts lower than upperBoundOnCost, so create our structures and process it. this.queue = new GenericBinaryHeapPriorityQueueWithTimestamp<VertexEntry>(); this.visitedVertices = new List<VisibilityVertexRectilinear> { source }; if (sourceVertexEntries == null) { EnqueueInitialVerticesFromSource(cost); } else { EnqueueInitialVerticesFromSourceEntries(sourceVertexEntries); } return this.queue.Count > 0; }
private void Cleanup() { foreach (var v in this.visitedVertices) { v.RemoveVertexEntries(); } this.visitedVertices.Clear(); this.queue = null; this.TestClearIterations(); }