private List<User> CreateBlankUser(int userNumber, List<GeoXYRect> rects, CellServiceContext ctx) { List<User> list = new List<User>(); while (true) { double num; double num2; if (userNumber <= 0) { return list; } User user = new User(); ClutterInfo info = new ClutterInfo(-1); int num3 = this.m_Random.Next(0, rects.Count); this.GenUserXY(user, out num, out num2, rects[num3]); GeoXYPoint geoXYPoint = new GeoXYPoint(num, num2); if (this.m_CellRectHelper.IsPoiontIsPolyRegion(geoXYPoint)) { user.Clutter = info; user.Service = ctx.Service; user.LinkType = ctx.LinkType; user.Priority = 1; list.Add(user); if (userNumber == list.Count) { return list; } } } }
private List<User> CreateUsers(CellServiceContext ctx, List<GeoXYPoint> pts, short clutterID) { List<User> list = new List<User>(); foreach (GeoXYPoint point in pts) { User item = new User { X = point.X, Y = point.Y, Service = ctx.Service, LinkType = ctx.LinkType }; ClutterInfo info = new ClutterInfo { Id = clutterID }; item.Clutter = info; item.UserProfile = string.Empty; item.Priority = 1; list.Add(item); } return list; }
private void SaveCellService(Transceiver lteCell, Dictionary<Transceiver, List<CellServiceContext>> cellSvcCtxDict, List<CellServiceContext> cellSvcCtxLst, DataGridViewCell gridCell) { int num; if (!cellSvcCtxDict.ContainsKey(lteCell)) { cellSvcCtxDict.Add(lteCell, cellSvcCtxLst); } CellServiceContext item = new CellServiceContext(); string headerText = this.m_GridCellService.Columns[gridCell.ColumnIndex].HeaderText; item.Service = this.m_AllCellServiceContext[headerText].Service; item.LinkType = this.m_AllCellServiceContext[headerText].LinkType; int.TryParse(gridCell.Value.ToString(), out num); item.UserCnt = num; cellSvcCtxLst.Add(item); }
private void LoadServiceColumns() { this.m_AllCellServiceContext = new Dictionary<string, CellServiceContext>(); this.setServiceDic(); foreach (Service service in this.m_ServiceList) { CellServiceContext context = new CellServiceContext { Service = service, LinkType = LinkType.Uplink }; string key = service.Name + TrafficMapResource.TRAFFICMAP_CELLMAP_UL; this.m_AllCellServiceContext.Add(key, context); context = new CellServiceContext { Service = service, LinkType = LinkType.Downlink }; key = service.Name + TrafficMapResource.TRAFFICMAP_CELLMAP_DL; this.m_AllCellServiceContext.Add(key, context); } this.AddServiceGrid(); }
private void GenerateUserPerService(short cellID, CellServiceContext ctx, int scalingFactor, CellTrafficMap map, MapClutterHelper clutterHelper, bool isFixure) { Predicate<GeoXYPoint> match = null; int count = this.m_UserCollection.UserList.Count; foreach (short num2 in clutterHelper.CluttersId) { List<int> list3; bool flag; List<GeoXYRect> cellRects = this.GetCellRects(cellID); int num3 = Convert.ToInt32((double) ((ctx.UserCnt * scalingFactor) * clutterHelper.ClutterWeightFactorDict[num2])); int max = clutterHelper.ClutterPtsCntDict[num2]; int cnt = num3; List<GeoXYPoint> pts = new List<GeoXYPoint>(); goto Label_00E4; Label_0072: list3 = this.GetRandomIdx(max, cnt); List<GeoXYPoint> collection = this.GetRandomClutterPts(cellRects, num2, list3, isFixure); if (match == null) { match = geoXYPoint => !this.m_CellRectHelper.IsPoiontIsPolyRegion(geoXYPoint); } collection.RemoveAll(match); pts.AddRange(collection); if ((pts.Count < num3) && (cnt > 0)) { cnt -= pts.Count; } else { goto Label_00E9; } Label_00E4: flag = true; goto Label_0072; Label_00E9: cnt = 0; List<User> users = this.CreateUsers(ctx, pts, num2); this.SetUserProperties(users, map, num2); this.m_UserCollection.UserList.AddRange(users); } }
private void GenerateBlankUserPerService(short cellID, CellServiceContext ctx, int scalingFactor, CellTrafficMap map) { List<GeoXYRect> cellRects = this.GetCellRects(cellID); int userNumber = Convert.ToInt32((int) (ctx.UserCnt * scalingFactor)); List<User> users = this.CreateBlankUser(userNumber, cellRects, ctx); this.SetBlanUserProperties(users, map); this.m_UserCollection.UserList.AddRange(users); }