public void AddAlgorithms(List <Algorithm> algos) { foreach (var algo in algos) { var algoID = algo.AlgorithmStringID; double secondarySpeed = 0; if (algo is DualAlgorithm dualAlgo) { secondarySpeed = dualAlgo.SecondaryBenchmarkSpeed; } if (BenchmarkSums.ContainsKey(algoID) == false) { var ssc = new SpeedSumCount { Count = 1, Speed = algo.BenchmarkSpeed, SecondarySpeed = secondarySpeed }; BenchmarkSums[algoID] = ssc; } else { BenchmarkSums[algoID].Count++; BenchmarkSums[algoID].Speed += algo.BenchmarkSpeed; BenchmarkSums[algoID].SecondarySpeed += secondarySpeed; } } }
public Dictionary <string, double> CalculateAvarages() { Dictionary <string, double> ret = new Dictionary <string, double>(); foreach (var kvp in this.BenchmarkSums) { string algo_id = kvp.Key; SpeedSumCount ssc = kvp.Value; ret[algo_id] = ssc.GetAvarage(); } return(ret); }
public Dictionary <string, List <double> > CalculateAvarages() { Dictionary <string, List <double> > ret = new Dictionary <string, List <double> >(); foreach (var kvp in this.BenchmarkSums) { string algo_id = kvp.Key; SpeedSumCount ssc = kvp.Value; ret[algo_id] = new List <double> { ssc.GetAvarage(), ssc.GetSecondaryAverage() }; } return(ret); }
public void AddAlgorithms(List <Algorithm> algos) { foreach (var algo in algos) { var algo_id = algo.AlgorithmStringID; if (BenchmarkSums.ContainsKey(algo_id) == false) { var ssc = new SpeedSumCount(); ssc.count = 1; ssc.speed = algo.BenchmarkSpeed; BenchmarkSums[algo_id] = ssc; } else { BenchmarkSums[algo_id].count++; BenchmarkSums[algo_id].speed += algo.BenchmarkSpeed; } } }