Exemple #1
0
 private static void LoadTree(IRangeMap <int> tree, int count, ref ParkAndMiller random)
 {
     for (int i = 0; i < count; i++)
     {
         int start = random.Next() % Math.Max(1, tree.GetExtent());
         tree.NearestLessOrEqual(start, out start);
         int xLength = random.Next() % 100 + 1;
         tree.Insert(start, xLength, random.Next());
     }
 }
Exemple #2
0
        private static void UnloadTree(IRangeMap <int> tree, int?count, ref ParkAndMiller random)
        {
            int i = 0;

            while ((count.HasValue && (i < count.Value)) || (!count.HasValue && (tree.Count != 0)))
            {
                int start = random.Next() % tree.GetExtent();
                tree.NearestLessOrEqual(start, out start);
                tree.Delete(start);
                i++;
            }
        }
Exemple #3
0
 public AllocTestRangeMap(IRangeMap <float> actual)
 {
     this.actual = actual;
 }
Exemple #4
0
 public override void UntimedPrepare()
 {
     tree = makeTree(count);
 }