Ejemplo n.º 1
0
 public static int GetNumberPictInRangeFixTrajectory(Satellite satellite, KdTree<float, PicCollection> tree, int maxIter)
 {
     if (maxIter < 0)
     {
         return 0;
     }
     var copySatellite = satellite.Clone();
     copySatellite.NextTurn();
     return tree.RadialSearch(new float[] { copySatellite.Pos.Lat, copySatellite.Pos.Lon }, copySatellite.MaxRot, 150)
         .Where(no => no.Value.PictureCanBeTaken(copySatellite.CurrentTurn))
         .Where(k => copySatellite.CanTakePicture((int)k.Point[0], (int)k.Point[1])).Count() + GetNumberPictInRangeFixTrajectory(copySatellite, tree, --maxIter);
 }
Ejemplo n.º 2
0
        public static int GetNumberPictInRangeInNextTurns(Satellite satellite, KdTreeNode<float, PicCollection> n, KdTree<float, PicCollection> tree)
        {
            var possiblePict = new Coords((int)n.Point[0], (int)n.Point[1]);
            var copySatellite = satellite.Clone();
            copySatellite.TakePicture(possiblePict);
            copySatellite.NextTurn();
            var inRange = tree.RadialSearch(new float[] { copySatellite.Pos.Lat, copySatellite.Pos.Lon }, copySatellite.MaxRot, 150)
                .Where(no => no.Value.PictureCanBeTaken(copySatellite.CurrentTurn))
                .Where(k => copySatellite.CanTakePicture((int)k.Point[0], (int)k.Point[1])).Count() + GetNumberPictInRangeFixTrajectory(copySatellite, tree, 500);

            //Console.WriteLine("Number in range for {0} {1}: {2}", possiblePict.Lat, possiblePict.Lon, inRange);
            return inRange;
        }