示例#1
0
        public void FinalResults(IEditLocationResults res)
        {
            lock (Lock)
            {
                Log("Final Result:\n");
                LogRes(res);

                foreach (var loc in res.AppliedEditLocations)
                {
                    _flatHistAll.Add(loc.Location, loc.Size);
                    _flatHistApplied.Add(loc.Location, loc.Size);
                    SortIn(loc);
                }
                foreach (var loc in res.OtherEditLocations)
                {
                    _flatHistAll.Add(loc.Location, loc.Size);
                    _flatHistOther.Add(loc.Location, loc.Size);
                    SortIn(loc);
                }

                Print("histogram 2:", _histogram2);
                Print("histogram 3:", _histogram3);
                Print("histogram 4:", _histogram4);
                Print("histogram 5:", _histogram5);
                Print("histogram 6:", _histogram6);
                Print("histogram 7:", _histogram7);
                Print("histogram 8:", _histogram8);
                Print("histogram 9:", _histogram9);
                Print("histogram 10+:", _histogram10P);

                Console.WriteLine(@"flat histogram (all):");
                Console.WriteLine(_flatHistAll);

                Console.WriteLine(@"flat histogram (applied):");
                Console.WriteLine(_flatHistApplied);

                Console.WriteLine(@"flat histogram (other):");
                Console.WriteLine(_flatHistOther);

                HistToCsv("all", _flatHistAll);
                HistToCsv("applied", _flatHistApplied);
                HistToCsv("other", _flatHistOther);
            }
        }
示例#2
0
        public void GetSizeLarge()
        {
            _sut = new FlatHistogram(10);
            var r = new Random();

            for (var i = 0; i < 1000; i++)
            {
                var methodSize = r.Next(30);
                var bin        = r.Next(methodSize);
                // implementation is one-based
                _sut.Add(bin + 1, methodSize + 1);
            }
            Assert.AreEqual(1000, _sut.GetSize());
        }
示例#3
0
 public void C4()
 {
     _sut = new FlatHistogram(5);
     _sut.Add(1, 2);
     AssertBins(0.4, 0.4, 0.2, 0.0, 0.0);
 }
示例#4
0
 public void A()
 {
     _sut.Add(1, 3);
     AssertBins(1.0, 0.0, 0.0);
 }