コード例 #1
0
        private void RemoveCoveredWakeEntry(PruningRegion p)
        {
            List<int> removeList = new List<int>();

            //Get a list of points dominated by p
            for (int i = 0; i < wakeList.Count; i++)
                if (p.Covers(wakeList[i].MBR))
                    removeList.Add(i);

            //Remove the list of dominated points from skyline
            for (int i = removeList.Count - 1; i >= 0; i--)
                wakeList.RemoveAt(removeList[i]);
        }
コード例 #2
0
 public bool Covers(PruningRegion p)
 {
     return Covers(p.Pivot);
 }
コード例 #3
0
        //private void RemoveCoveredPoints(PruningRegion p)
        //{
        //    List<int> removeList = new List<int>();
        //    //We need to test every point in skyline list.
        //    //domTestCount += skyline.Count;
        //    //Get a list of points dominated by p
        //    for (int i = 0; i < skyline.Count; i++)
        //        if (p.Covers(skyline[i]))
        //            removeList.Add(i);
        //    //Remove the list of dominated points from skyline
        //    for (int i = removeList.Count - 1; i >= 0; i--)
        //        skyline.RemoveAt(removeList[i]);
        //}
        private void RemoveCoveredPruneRegion(PruningRegion p)
        {
            List<int> removeList = new List<int>();

            //Get a list of points dominated by p
            for (int i = 0; i < pruneRegs.Count; i++)
                if (p.Covers(pruneRegs[i]))
                    removeList.Add(i);

            //Remove the list of dominated points from skyline
            for (int i = removeList.Count - 1; i >= 0; i--)
                pruneRegs.RemoveAt(removeList[i]);
        }
コード例 #4
0
        /***********************************************
         * Copied From PointBasedPruning.cs
         * ********************************************/
        private void ComputeSkyline(List<Point> points)
        {
            for (int i = 0; i < points.Count; i++)
            {
                bool dominated = false;

                for (int j = 0; j < points.Count; j++)
                {
                    if (i == j)
                        continue;
                    if (Dominates(points[j], points[i], pref))
                    {
                        dominated = true;
                        break;
                    }
                }

                if (!dominated)
                {
                    PruningRegion pruneReg =
                        new PruningRegion(points[i], pref);
                    //RemoveCoveredPoints(pruneReg);
                    RemoveCoveredPruneRegion(pruneReg);
                    RemoveCoveredWakeEntry(pruneReg);
                    //skyline.Add(points[i]);
                    pruneRegs.Add(pruneReg);
                }
            }
        }
コード例 #5
0
        private void RemoveCoveredPoints(PruningRegion p)
        {
            List<int> removeList = new List<int>();

            //We need to test every point in skyline list.
            //domTestCount += skyline.Count;

            //Get a list of points dominated by p
            for (int i = 0; i < skyline.Count; i++)
                if (p.Covers(skyline[i]))
                    removeList.Add(i);

            //Remove the list of dominated points from skyline
            for (int i = removeList.Count - 1; i >= 0; i--)
                skyline.RemoveAt(removeList[i]);
        }
コード例 #6
0
        /// <summary>
        /// Adds a pruning region to the pruning region list and remove
        /// skyline points and pruning regions covered by this pruning region.
        /// </summary>
        /// <param name="p">The pruning region to be added.</param>
        private void AddPruningRegion(PruningRegion p, bool removePoints)
        {
            //Check if this pruning region is covered by another
            foreach (PruningRegion pruneReg in pruneRegs)
                if (pruneReg.Covers(p))
                    return;

            if (removePoints)
                RemoveCoveredPoints(p);
            RemoveCoveredPruneRegion(p);
            pruneRegs.Add(p);
        }
コード例 #7
0
        private List<PruningRegion> MakePruneRegs(IndexEntry entry)
        {
            int dimension = entry.MBR.Dimensions;
            Orthotope bounds = entry.MBR;
            List<PruningRegion> pruneRegs = new List<PruningRegion>();
            for (int i = 0; i < dimension; i++)
            {
                Point pivot = new Point(dimension);

                for (int j = 0; j < dimension; j++)
                {
                    if (i == j)
                    {
                        if (pref[j] == PrefSpec.Min)
                            pivot[j] = bounds.Max[j];
                        else
                            pivot[j] = bounds.Min[j];
                    }
                    else
                    {
                        if (pref[j] == PrefSpec.Min)
                            pivot[j] = bounds.Min[j];
                        else
                            pivot[j] = bounds.Max[j];
                    }
                }

                PruningRegion pruneReg = new PruningRegion(pivot, pref);

                //Check if the new pruning region is covered
                bool covered = false;
                foreach (PruningRegion p in this.pruneRegs)
                {
                    if (p.Covers(pruneReg))
                    {
                        covered = true;
                        break;
                    }
                }

                if(!covered)
                    pruneRegs.Add(pruneReg);
            }

            return pruneRegs;
        }