Пример #1
0
        private double CalculateTimesFunction(TestKey testParamsKey, Dictionary <TestKey, double> timesDictionary)
        {
            double value = RunTest(testParamsKey.ProcessCount, testParamsKey.TaskArgs);

            timesDictionary.Add(testParamsKey, value);
            return(value);
        }
Пример #2
0
        private double CalculateCostFunction(TestKey testKey,
                                             Dictionary <TestKey, double> times,
                                             Dictionary <TestKey, double> cost)
        {
            double value = times[testKey] * testKey.ProcessCount;

            cost.Add(testKey, value);
            return(value);
        }
Пример #3
0
        private double CalculateEfficiencyFunction(TestKey testParamsKey,
                                                   Dictionary <TestKey, double> acceleration,
                                                   Dictionary <TestKey, double> efficiency)
        {
            double value = acceleration[testParamsKey] / testParamsKey.ProcessCount;

            efficiency.Add(testParamsKey, value);
            return(value);
        }
Пример #4
0
        private double CalculateAccelerationFunction(TestKey testParamsKey,
                                                     Dictionary <TestKey, double> times,
                                                     Dictionary <TestKey, double> acceleration)
        {
            int    processesKey     = processesList[0]; // base process
            var    singleProcessKey = new TestKey(processesKey, testParamsKey.TaskArgs);
            double value            = times[singleProcessKey] / times[testParamsKey];

            acceleration.Add(testParamsKey, value);
            return(value);
        }
Пример #5
0
        private void WriteDictionary(Func <TestKey, double> callBack)
        {
            WriteHeader(testsArgs);

            foreach (int process in processesList)
            {
                Console.Write($"{process,15:D}");
                foreach (string testArgs in testsArgs)
                {
                    var    testKey = new TestKey(process, testArgs);
                    double result  = callBack.Invoke(testKey);
                    Console.Write($"{result,15:F4}");
                }

                Console.WriteLine();
            }
        }