public AlgorithmResult Aggregate(IEnumerable <AlgorithmResult> results) { var res = results.OrderBy(a => a.Similarity).ToArray(); var agg = res[res.Length / 2]; return(AlgorithmResult.Res(Constants.AggregatorId, agg.Similarity, agg.AlgorithmVerdict)); }
public AlgorithmAggregatedResult Check(Source source1, Source source2) { var answer = new List <AlgorithmResult>(); foreach (var algo in Algos) { var baseAlgo = (algo as BaseAlgorithm); var cmpRes = algo.CompareSrc(source1, source2); var res = AlgorithmResult.Res(baseAlgo.Id, cmpRes.Key, cmpRes.Value); answer.Add(res); } var result = new AlgorithmAggregatedResult(); result.AlgoResults = answer.ToArray(); result.AggregationInfo = Aggregator.Aggregate(answer); return(result); }
public AlgorithmResult Aggregate(IEnumerable <AlgorithmResult> results) { var agg = results.Aggregate((a, b) => a.Similarity > b.Similarity ? a : b); return(AlgorithmResult.Res(Constants.AggregatorId, agg.Similarity, agg.AlgorithmVerdict)); }