Exemplo n.º 1
0
        public void RunTestGroup(int maxEntries, int numberOfItems)
        {
            RBush <Item> rBush = new RBush <Item>(maxEntries);

            double             spaceScale = 50;
            IEnumerable <Item> items      = ItemListGenerator.GenerateItems(numberOfItems, spaceScale);

            Console.WriteLine("maxEntries = " + maxEntries);

            // Tests:

            RunTest("BulkLoad", numberOfItems, () => { rBush.BulkLoad(items); });

            RunTest("Search OLD", numberOfItems, () => { rBush.Search_Old(); });
            RunTest("Search NEW", numberOfItems, () => { rBush.Search(); });

            RunTest("Search envelope (Inf. bounds) OLD", numberOfItems, () => { rBush.Search_Old(Envelope.InfiniteBounds); });
            RunTest("Search envelope (Inf. bounds) NEW", numberOfItems, () => { rBush.Search(Envelope.InfiniteBounds); });

            RunTest("Iterate through IEnumerable [for comparison]", numberOfItems, () => { foreach (Item i in items)
                                                                                           {
                                                                                           }
                    });

            Console.ReadLine();
        }