Example #1
0
        public static void DomTestSimIncBf(int size, int d)
        {
            Console.WriteLine("Begine DomTestSimIncBf()");

            string outPath = "DomTestIncBf_r" + size + ".txt";

            using (StreamWriter streamWriter = new StreamWriter(outPath))
            {

                for (int b = 2; b <= 50; b++)
                {
                    Console.WriteLine("Branching: " + b);

                    streamWriter.Write(b.ToString() + '\t');

                    //Uniformed
                    GridRTree rtree = new GridRTree(
                        UniformDataPath(d, size),
                        b   //branching factor
                    );

                    streamWriter.Write(new PointBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');
                    streamWriter.Write(new IndexBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');

                    //Rising
                    rtree = new GridRTree(
                        GetAllDataPath(DataType.Rising, d, size),
                        b   //branching factor
                    );

                    streamWriter.Write(new PointBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');
                    streamWriter.Write(new IndexBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');

                    //Falling
                    rtree = new GridRTree(
                        GetAllDataPath(DataType.Falling, d, size),
                        b   //branching factor
                    );

                    streamWriter.Write(new PointBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');
                    streamWriter.WriteLine(new IndexBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString());
                }
            }

            Console.WriteLine("End DomTestSimIncBf()");
        }
        public PointBasedPruning(GridRTree rtree, PrefSpec[] pref)
        {
            if (rtree == null || pref == null)
                throw new ArgumentNullException();

            pruneRegs = new List<PruningRegion>();
            skyline = new List<Point>();
            this.rtree = rtree;
            this.pref = pref;

            domTestCount = 0;
            ran = false;
        }
        public PointBasedTuneTime(GridRTree rtree, int repLevel,
            PrefSpec[] prefs)
        {
            if (rtree == null)
                throw new ArgumentNullException();
            if (repLevel < 0)
                throw new ArgumentException();

            this.pruneRegs = new List<PruningRegion>();
            this.wakeList = new List<IndexEntry>();
            this.rtree = rtree;
            this.repLevel = repLevel;

            pref = new PrefSpec[rtree.Root.Bounds.Dimensions];
            Array.Copy(prefs, pref, pref.Length);
        }
 public static double GetPercentage(GridRTree rtree, int m)
 {
     long indexBytes = m * GetIndexInBytes(rtree.Root);
     long dataBytes = GetDataPointsInBytes(rtree);
     return (double)indexBytes / (indexBytes + dataBytes);
 }
 public static long GetIndexInBytes(GridRTree rtree)
 {
     return GetIndexInBytes(rtree.Root);
 }
Example #6
0
        static void IndexPercIncBf()
        {
            string dataPath = GetAllDataPath(DataType.Uniform, 3, 10000);
            int rep = 2;
            //int m = ??
            string outPath = "IncreaseBranchingFactor.txt";

            using (StreamWriter streamWriter = new StreamWriter(outPath))
            {
                for (int i = 2; i <= 15; i++)
                {
                    //string file = "uniform_d3_r20000_c20000";
                    GridRTree rtree = new GridRTree(dataPath, i);
                    streamWriter.Write(
                        OneTimeIndexPercentage.GetDataPointsInBytes(rtree).ToString() + "\t");
                    streamWriter.Write(
                        OneTimeIndexPercentage.GetIndexInBytes(rtree.Root).ToString() + "\t");
                    //Console.Write(
                    //    OneMIndexPercentage.GetIndexInBytes(rtree.Root).ToString() + "\t");
                    streamWriter.Write(
                        DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
                    streamWriter.Write(
                        OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
                    streamWriter.Write(
                        OneMIndexPercentage.GetPercentage(rtree, 2).ToString("f4") + "\t");
                    streamWriter.WriteLine(
                        DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
                }
            }
        }
Example #7
0
        static void IncRecordCountDomTestPB()
        {
            string dataPath = DataPath() + "\\inc_record\\";
            int b = 10;
            int rep = 2;
            PrefSpec[] pref = {PrefSpec.Min, PrefSpec.Min, PrefSpec.Min};

            //int m = ??
            for (int i = 1; i <= 10; i++)
            {
                string file = "uniform_d3" + "_r" + i * 10000 + "_c" + i * 10000;
                GridRTree rtree = new GridRTree(dataPath + file, b);
                PointBasedPruning pbp = new PointBasedPruning(rtree, pref);
                Console.WriteLine(pbp.DominanceCount);
            }
        }
Example #8
0
 static void IncreaseRecordCount()
 {
     string dataPath = DataPath() + "\\uniform\\3d\\";
     int b = 10;
     int rep = 2;
     //int m = ??
     for (int i = 1; i <= 10; i++)
     {
         string file = "uniform_d3" + "_r" + i * 10000 + "_c" + i * 10000 + ".txt";
         GridRTree rtree = new GridRTree(dataPath + file, b);
         Console.Write(
             OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
         Console.Write(
             OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
         //Console.Write(
         //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
         Console.Write(
             DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
         Console.Write(
             OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
         Console.Write(
             OneMIndexPercentage.GetPercentage(rtree, 2).ToString("f4") + "\t");
         Console.Write(
             DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
         Console.WriteLine();
     }
 }
Example #9
0
        static void IncreaseDimension()
        {
            string dataPath = DataPath() + "\\data_inc_dim\\";
            int b = 10;
            int rep = 2;
            //int m = ??
            GridRTree rtree = new GridRTree(dataPath + "skyline_2d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_3d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_4d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_5d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_6d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_7d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_8d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_9d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();

            rtree = new GridRTree(dataPath + "skyline_10d_10000.txt", b);
            Console.Write(
                OneTimeIndexPercentage.GetDataPointsInBytes(rtree) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            //Console.Write(
            //    OneMIndexPercentage.GetIndexInBytes(rtree.Root) + "\t");
            Console.Write(
                DFDIIndexPercentage.GetIndexInBytes(rtree.Root, 1, rep) + "\t");
            Console.Write(
                OneTimeIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                OneMIndexPercentage.GetPercentage(rtree).ToString("f4") + "\t");
            Console.Write(
                DFDIIndexPercentage.GetPercentage(rtree, rep).ToString("f4") + "\t");
            Console.WriteLine();
        }
Example #10
0
        public static void TuningTime_IncSize_Uniform_MinMaxMixed(int d, int b)
        {
            Console.WriteLine("Begine TuningTime_IncSize_Uniform_MinMaxMixed()");

            string outPath = "TuningTime_IncSize_Uniform_MinMaxMixed_d" + d + ".txt";

            using (StreamWriter streamWriter = new StreamWriter(outPath))
            {

                streamWriter.WriteLine("Record Count\tP-B (Min, Min)\tI-B (Min, Min)" +
                    "\tP-B (Min, Max)\tI-B (Min, Max)" +
                    "\tP-B (Max, Min)\tI-B (Max, Min)" +
                    "\tP-B (Max, Max)\tI-B (Max, Max)");

                for (int dsSize = 10000; dsSize <= 100000; dsSize += 10000)
                {
                    Console.WriteLine("Size: " + dsSize);

                    streamWriter.Write(dsSize.ToString() + '\t');

                    //min, min
                    GridRTree rtree = new GridRTree(
                        GetAllDataPath(DataType.Uniform, d, dsSize),
                        b //+ ((dsSize / 10000) - 1)  //branching factor
                    );

                    streamWriter.Write(new PointBasedTuneTime(rtree, 1,
                        minPref[d]).GetTuningTime().ToString() + '\t');
                    streamWriter.Write(new IndexBasedTuneTime(rtree, 1,
                        minPref[d]).GetTuningTime().ToString() + '\t');

                    //min, max
                    streamWriter.Write(new PointBasedTuneTime(rtree, 1,
                        minMaxPref).GetTuningTime().ToString() + '\t');
                    streamWriter.Write(new IndexBasedTuneTime(rtree, 1,
                        minMaxPref).GetTuningTime().ToString() + '\t');

                    //max, min
                    streamWriter.Write(new PointBasedTuneTime(rtree, 1,
                        maxMinPref).GetTuningTime().ToString() + '\t');
                    streamWriter.Write(new IndexBasedTuneTime(rtree, 1,
                        maxMinPref).GetTuningTime().ToString() + '\t');

                    //max, max
                    streamWriter.Write(new PointBasedTuneTime(rtree, 1,
                        maxPref[d]).GetTuningTime().ToString() + '\t');
                    streamWriter.WriteLine(new IndexBasedTuneTime(rtree, 1,
                        maxPref[d]).GetTuningTime().ToString());
                }
            }
            Console.WriteLine("End TuningTime_IncSize_Uniform_MinMaxMixed()");
        }
Example #11
0
        public static void TuningTime_IncDim_Uniform_AllMinAllMax(int dsSize, int b)
        {
            Console.WriteLine("Begine TuningTime_IncDim_Uniform_AllMinAllMax()");

            string outPath = "TuningTime_IncDim_Uniform_AllMinAllMax_r" + dsSize + ".txt";

            using (StreamWriter streamWriter = new StreamWriter(outPath))
            {

                streamWriter.WriteLine("Dimension\tP-B All Min\tI-B All Min" +
                    "\tP-B All Max\tI-B All Max");

                for (int d = 2; d <= 10; d++)
                {
                    Console.WriteLine("Dimension: " + d);

                    streamWriter.Write(d.ToString() + '\t');

                    //min, min
                    GridRTree rtree = new GridRTree(
                        GetAllDataPath(DataType.Uniform, d, dsSize),
                        b //+ ((dsSize / 10000) - 1)  //branching factor
                    );

                    streamWriter.Write(new PointBasedTuneTime(rtree, 1,
                        minPref[d]).GetTuningTime().ToString() + '\t');
                    streamWriter.Write(new IndexBasedTuneTime(rtree, 1,
                        minPref[d]).GetTuningTime().ToString() + '\t');

                    //max, max
                    streamWriter.Write(new PointBasedTuneTime(rtree, 1,
                        maxPref[d]).GetTuningTime().ToString() + '\t');
                    streamWriter.WriteLine(new IndexBasedTuneTime(rtree, 1,
                        maxPref[d]).GetTuningTime().ToString());
                }
            }
            Console.WriteLine("End TuningTime_IncDim_Uniform_AllMinAllMax()");
        }
Example #12
0
        public static void TuningSimSuite(int d, int b, PrefSpec[] prefs)
        {
            Console.WriteLine("Begine TuningSimSuite()");

            string outPath = "TuningSim_d" + d + ".txt";

            using (StreamWriter streamWriter = new StreamWriter(outPath))
            {

                for (int dsSize = 10000; dsSize <= 100000; dsSize += 10000)
                {
                    Console.WriteLine("Size: " + dsSize);

                    streamWriter.Write(dsSize.ToString() + '\t');

                    //Uniformed
                    GridRTree rtree = new GridRTree(
                        GetDataPath(DataType.Uniform, d, dsSize),
                        b   //branching factor
                    );

                    streamWriter.Write(new PointBasedTuneTime(rtree,
                        1, prefs).GetTuningTime().ToString() + '\t');
                    streamWriter.Write(new IndexBasedTuneTime(rtree,
                        1, prefs).GetTuningTime().ToString() + '\t');

                    //Rising
                    rtree = new GridRTree(
                        GetDataPath(DataType.Rising, d, dsSize),
                        b   //branching factor
                    );

                    streamWriter.Write(new PointBasedTuneTime(rtree,
                        1, prefs).GetTuningTime().ToString() + '\t');
                    streamWriter.Write(new IndexBasedTuneTime(rtree,
                        1, prefs).GetTuningTime().ToString() + '\t');

                    //Falling
                    rtree = new GridRTree(
                        GetDataPath(DataType.Falling, d, dsSize),
                        b   //branching factor
                    );

                    streamWriter.Write(new PointBasedTuneTime(rtree,
                        1, prefs).GetTuningTime().ToString() + '\t');
                    streamWriter.WriteLine(new IndexBasedTuneTime(rtree,
                       1, prefs).GetTuningTime().ToString());
                }
            }

            Console.WriteLine("End TuningSimSuite()");
        }
Example #13
0
        public static void DomTestSimSuite(int d, int b)
        {
            Console.WriteLine("Begine DomTestSimSuite()");

            string outPath = "DomTest_d" + d + ".txt";

            using (StreamWriter streamWriter = new StreamWriter(outPath))
            {

                for (int dsSize = 10000; dsSize <= 100000; dsSize += 10000)
                {
                    Console.WriteLine("Size: " + dsSize);

                    streamWriter.Write(dsSize.ToString() + '\t');

                    //Uniformed
                    GridRTree rtree = new GridRTree(
                        GetAllDataPath(DataType.Uniform, d, dsSize),
                        b //+ ((dsSize / 10000) - 1)  //branching factor
                    );

                    streamWriter.Write(new PointBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');
                    streamWriter.Write(new IndexBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');

                    //Rising
                    rtree = new GridRTree(
                        GetAllDataPath(DataType.Rising, d, dsSize),
                        b //+ ((dsSize / 10000) - 1)   //branching factor
                    );

                    streamWriter.Write(new PointBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');
                    streamWriter.Write(new IndexBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');

                    //Falling
                    rtree = new GridRTree(
                        GetAllDataPath(DataType.Falling, d, dsSize),
                        b //+ ((dsSize / 10000) - 1)   //branching factor
                    );

                    streamWriter.Write(new PointBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString() + '\t');
                    streamWriter.WriteLine(new IndexBasedPruning(rtree,
                        minPref[d]).DominanceCount.ToString());
                }
            }

            Console.WriteLine("End DomTestSimSuite()");
        }
Example #14
0
 public static long GetDataPointsInBytes(GridRTree rtree)
 {
     return GetDataPointsInBytes(rtree.Root);
 }