예제 #1
0
 private static bool IsDiscernablyDifferent(ScenarioMetricsResultModel a, ScenarioMetricsResultModel b, KPIComparisonConfig KPIComparison)
 {
     return(Math.Abs(
                a.GetKPIValue(KPIComparison.KPIName).Value -
                b.GetKPIValue(KPIComparison.KPIName).Value)
            < KPIComparison.DiscernibleDifference);
 }
예제 #2
0
        private static List <List <ScenarioMetricsResultModel> > GroupByDiscernableDifference(List <ScenarioMetricsResultModel> results, KPIComparisonConfig KPIComparison)
        {
            var resultGroups = new List <List <ScenarioMetricsResultModel> >();
            var currentGroup = new List <ScenarioMetricsResultModel>();

            resultGroups.Add(currentGroup);

            results.ForEach(item =>
            {
                if (currentGroup.Count() == 0 || IsDiscernablyDifferent(currentGroup.First(), item, KPIComparison))
                {
                    currentGroup.Add(item);
                }
                else
                {
                    currentGroup = new List <ScenarioMetricsResultModel>();
                    resultGroups.Add(currentGroup);
                    currentGroup.Add(item);
                }
            });

            return(resultGroups);
        }