예제 #1
0
        public Point[] GetBestPoint(Point startPoint, Point[] nextPossiblePoints, int beamWith)
        {
            var bestPoints = new DistanceAndPointIdArray(beamWith);

            foreach (var point in nextPossiblePoints)
            {
                var distance = point.CalculateDistanceTo(startPoint);
                bestPoints.InsertIfPossible(distance, point);
            }
            return(bestPoints.CreatePointArray());
        }
예제 #2
0
        public Point[] GetBestPoint(Point startPoint, Point[] nextPossiblePoints, int beamWith)
        {
            var bestPoints = new DistanceAndPointIdArray(beamWith);

            for (int i = 0; i < nextPossiblePoints.Length; i++)
            {
                var point    = nextPossiblePoints[i];
                var distance = point.CalculateDistanceTo(startPoint);
                bestPoints.InsertIfPossible(distance, point);
            }
            return(bestPoints.CreatePointArray());
        }