public KdTreeStrategy(IEnumerable <IP> points, ILog2 log = null)
        {
            _log = log ?? new NoLog();
            var vectors = points.Select(p => new DenseVector(new[] { p.X, p.Y })).ToList();

            Tree = KdTree <Vector <double>, double> .Construct(2, vectors.ToArray());
        }
Esempio n. 2
0
        public Algorithm(
            IPoints points, IRectangle rect, StrategyType type = StrategyType.Grid, ILog2 log = null)
        {
            _log = log ?? new NoLog();
            Rectangle = rect;
            Points = points.Data;
            Singles = new List<IP>();
            Knn = new NearestNeighbor();

            GridContainer = new GridContainer(Rectangle, Points);

            switch (type)
            {
                case StrategyType.Naive:
                    Strategy = new NaiveStrategy(_log);
                    break;
                case StrategyType.Grid:
                    Strategy = new GridStrategy(_log);
                    break;
                case StrategyType.KdTree:
                    Strategy = new KdTreeStrategy(Points);
                    break;
                default:
                    throw new NotImplementedException("Unknown strategy");
            }

            //_log.Info(MethodBase.GetCurrentMethod(), "object init");
        }
Esempio n. 3
0
        public Algorithm(
            IPoints points, IRectangle rect, StrategyType type = StrategyType.Grid, ILog2 log = null)
        {
            _log      = log ?? new NoLog();
            Rectangle = rect;
            Points    = points.Data;
            Singles   = new List <IP>();
            Knn       = new NearestNeighbor();

            GridContainer = new GridContainer(Rectangle, Points);

            switch (type)
            {
            case StrategyType.Naive:
                Strategy = new NaiveStrategy(_log);
                break;

            case StrategyType.Grid:
                Strategy = new GridStrategy(_log);
                break;

            case StrategyType.KdTree:
                Strategy = new KdTreeStrategy(Points);
                break;

            default:
                throw new NotImplementedException("Unknown strategy");
            }

            //_log.Info(MethodBase.GetCurrentMethod(), "object init");
        }
Esempio n. 4
0
        void Application_Start(object sender, EventArgs e)
        {
            _log = new NoLog(); // Log4Net();
            _log.Info(MethodBase.GetCurrentMethod(), "Init");

            // Init Google Maps Clustering
            GmcInit.Init(HttpContext.Current.Server.MapPath("~") + @"\AreaGMC\Files\Points.csv");

            RegisterRoutes();
        }
        void Application_Start(object sender, EventArgs e)
        {
            _log = new NoLog(); // Log4Net();
               _log.Info(MethodBase.GetCurrentMethod(), "Init");

            // Init Google Maps Clustering
            GmcInit.Init(HttpContext.Current.Server.MapPath("~") + @"\AreaGMC\Files\Points.csv");

            RegisterRoutes();
        }
Esempio n. 6
0
 public GridStrategy(ILog2 log = null)
 {
     _log = log ?? new NoLog();
 }
 public Account(ILog2 log)
 {
     this.log = log;
 }
Esempio n. 8
0
 public GridStrategy(ILog2 log = null)
 {
     _log = log ?? new NoLog();
 }
Esempio n. 9
0
 public KdTreeStrategy(IEnumerable<IP> points, ILog2 log = null)
 {
     _log = log ?? new NoLog();
     var vectors = points.Select(p => new DenseVector(new[] { p.X, p.Y })).ToList();
     Tree = KdTree<Vector<double>, double>.Construct(2, vectors.ToArray());
 }
Esempio n. 10
0
 public NaiveStrategy(ILog2 log = null)
 {
     _log = log ?? new NoLog();
 }
 public NaiveStrategy(ILog2 log = null)
 {
     _log = log ?? new NoLog();
 }