Example #1
0
 public void IntermediateResults(int taskId, IEditLocationResults res)
 {
     lock (Lock)
     {
         Log("({0}) Intermediate Result:\n", taskId);
         LogRes(res);
     }
 }
 public void Add(IEditLocationResults other)
 {
     NumEvents           += other.NumEvents;
     NumCompletionEvents += other.NumCompletionEvents;
     NumLocations        += other.NumLocations;
     AppliedEditLocations.AddAll(other.AppliedEditLocations);
     OtherEditLocations.AddAll(other.OtherEditLocations);
 }
Example #3
0
        public void Run()
        {
            _results = new EditLocationResults {
                Zip = "all"
            };

            FindZips();
            InParallel(CreateStatistics);

            _log.FinalResults(_results);
        }
Example #4
0
        private static void LogRes(IEditLocationResults res)
        {
            var tmp = new EditLocationResults {
                Zip = res.Zip
            };

            tmp.Add(res);
            tmp.AppliedEditLocations.Clear();
            tmp.OtherEditLocations.Clear();

            Console.WriteLine("NumAppliedEditLocations = {0}", res.AppliedEditLocations.Count);
            Console.WriteLine("NumOtherEditLocations = {0}", res.OtherEditLocations.Count);
            Console.Write(tmp.ToString());
        }
Example #5
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);
            }
        }