public static List<TopPrecise4GContainer> Order(this IEnumerable<TopPrecise4GContainer> result, OrderPreciseStatPolicy policy, int topCount) { switch (policy) { case OrderPreciseStatPolicy.OrderBySecondRate: return result.OrderByDescending(x => x.PreciseCoverage4G.SecondRate) .Take(topCount).ToList(); case OrderPreciseStatPolicy.OrderBySecondNeighborsDescending: return result .Where(x => x.PreciseCoverage4G.SecondRate > Settings.Default.PreciseRateThreshold) .OrderByDescending(x => x.PreciseCoverage4G.SecondNeighbors) .Take(topCount).ToList(); case OrderPreciseStatPolicy.OrderByFirstRate: return result.OrderByDescending(x => x.PreciseCoverage4G.FirstRate) .Take(topCount).ToList(); case OrderPreciseStatPolicy.OrderByFirstNeighborsDescending: return result .Where(x => x.PreciseCoverage4G.SecondRate > Settings.Default.PreciseRateThreshold) .OrderByDescending(x => x.PreciseCoverage4G.FirstNeighbors) .Take(topCount).ToList(); case OrderPreciseStatPolicy.OrderByTopDatesDescending: return result .Where(x => x.PreciseCoverage4G.SecondRate > Settings.Default.PreciseRateThreshold) .OrderByDescending(x => x.TopDates).Take(topCount).ToList(); default: return result .Where(x => x.PreciseCoverage4G.SecondRate > Settings.Default.PreciseRateThreshold) .OrderByDescending(x => x.PreciseCoverage4G.TotalMrs) .Take(topCount).ToList(); } }
public static List <TopPrecise4GContainer> Order(this IEnumerable <TopPrecise4GContainer> result, OrderPreciseStatPolicy policy, int topCount) { switch (policy) { case OrderPreciseStatPolicy.OrderBySecondRate: return(result.OrderByDescending(x => x.PreciseCoverage4G.SecondRate) .Take(topCount).ToList()); case OrderPreciseStatPolicy.OrderBySecondNeighborsDescending: return(result.OrderByDescending(x => x.PreciseCoverage4G.SecondNeighbors) .Take(topCount).ToList()); case OrderPreciseStatPolicy.OrderByFirstRate: return(result.OrderByDescending(x => x.PreciseCoverage4G.FirstRate) .Take(topCount).ToList()); case OrderPreciseStatPolicy.OrderByFirstNeighborsDescending: return(result.OrderByDescending(x => x.PreciseCoverage4G.FirstNeighbors) .Take(topCount).ToList()); case OrderPreciseStatPolicy.OrderByTopDatesDescending: return(result.OrderByDescending(x => x.TopDates).Take(topCount).ToList()); default: return(result.OrderByDescending(x => x.PreciseCoverage4G.TotalMrs) .Take(topCount).ToList()); } }
public List<TopPrecise4GContainer> GetTopCountStats(DateTime begin, DateTime end, int topCount, OrderPreciseStatPolicy policy) { var query = _repository.GetAllList(x => x.StatTime >= begin && x.StatTime < end && x.TotalMrs > Settings.Default.TotalMrsThreshold); var result = query.GenerateContainers(); var orderResult = result.Order(policy, topCount); return orderResult; }
public List <TopPrecise4GContainer> GetTopCountStats(DateTime begin, DateTime end, int topCount, OrderPreciseStatPolicy policy) { var query = _repository.GetAllList(x => x.StatTime >= begin && x.StatTime <end && x.TotalMrs> Settings.Default.TotalMrsThreshold); var result = query.GenerateContainers(); var orderResult = result.Order(policy, topCount); return(orderResult); }
public IEnumerable<Precise4GView> GetTopCountViews(DateTime begin, DateTime end, int topCount, OrderPreciseStatPolicy policy, IEnumerable<ENodeb> eNodebs) { if (topCount <= 0) return new List<Precise4GView>(); var orderResult = GetTopCountStats(begin, end, topCount, policy, eNodebs); return orderResult.Select(x => { var view = Precise4GView.ConstructView(x.PreciseCoverage4G, _eNodebRepository); view.TopDates = x.TopDates; return view; }); }
public List<TopPrecise4GContainer> GetTopCountStats(DateTime begin, DateTime end, int topCount, OrderPreciseStatPolicy policy, IEnumerable<ENodeb> eNodebs) { ; var districtList = from q in _repository.GetAllList( x => x.StatTime >= begin && x.StatTime < end && x.TotalMrs > Settings.Default.TotalMrsThreshold) join e in eNodebs on q.CellId equals e.ENodebId select q; var result = districtList.GenerateContainers(); var orderResult = result.Order(policy, topCount); return orderResult; }
public List <TopPrecise4GContainer> GetTopCountStats(DateTime begin, DateTime end, int topCount, OrderPreciseStatPolicy policy, IEnumerable <ENodeb> eNodebs) { ; var districtList = from q in _repository.GetAllList( x => x.StatTime >= begin && x.StatTime <end && x.TotalMrs> Settings.Default.TotalMrsThreshold) join e in eNodebs on q.CellId equals e.ENodebId select q; var result = districtList.GenerateContainers(); var orderResult = result.Order(policy, topCount); return(orderResult); }
public IEnumerable <Precise4GView> GetTopCountViews(DateTime begin, DateTime end, int topCount, OrderPreciseStatPolicy policy, IEnumerable <ENodeb> eNodebs) { if (topCount <= 0) { return(new List <Precise4GView>()); } var orderResult = GetTopCountStats(begin, end, topCount, policy, eNodebs); return(orderResult.Select(x => { var view = Precise4GView.ConstructView(x.PreciseCoverage4G, _eNodebRepository); view.TopDates = x.TopDates; return view; })); }