private GeoPolygonRegion GenerateFullMapPolygon() { double maxValue = double.MaxValue; double minValue = double.MinValue; double num3 = double.MaxValue; double num4 = double.MinValue; double num5 = 0.0; foreach (Transceiver transceiver in this.m_otherSubSysInterface.INet.TranceiverList) { num5 = 0.0; foreach (PropModelConfig config in transceiver.Cells[0].PropModels) { num5 = Math.Max(num5, (double) config.CalcRadius); } maxValue = Math.Min(maxValue, (transceiver.AntConfiguration[0].DX + transceiver.Parent.X) - num5); minValue = Math.Max(minValue, (transceiver.AntConfiguration[0].DX + transceiver.Parent.X) + num5); num4 = Math.Max(num4, (transceiver.AntConfiguration[0].DY + transceiver.Parent.Y) + num5); num3 = Math.Min(num3, (transceiver.AntConfiguration[0].DY + transceiver.Parent.Y) - num5); } GeoXYRect geoXYRect = new GeoXYRect(maxValue, minValue, num3, num4); GeoPolygon geoPolygon = new GeoPolygon(geoXYRect); GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); region.Name = GeneralResource.GENERAL_FULL_MAP; return region; }
public List<IACell> GetCellListByNetWorkType(GeoPolygonRegion region, List<Transceiver> allTranceiverList, float resolution, NetWorkType predictionType) { List<Transceiver> copy = new List<Transceiver>(); foreach (var item in allTranceiverList) { if (item.Cells[0] is LTECell) { copy.Add(item); } } List<IACell> list = new List<IACell>(); if (region == null) { list.AddRange(this.GetCellListByNetWorkType(copy, predictionType)); return list; } PredictionBound boundOfPolygon = this.GetBoundOfPolygon(region, resolution); foreach (Transceiver transceiver in copy) { if (transceiver.Active && this.IsTranceiverInCalcZone(boundOfPolygon, transceiver)) { foreach (IACell cell in transceiver.Cells) { if (cell.NetType == predictionType) { list.Add(cell); } } } } return list; }
private GeoDisplayPolygonRegion(SerializationInfo info, StreamingContext context) { if (ProjectSingleton.Instance.OpenV3R5ProjectFile) { base.m_Comments = info.GetString("m_Remark"); this.m_Region = new GeoPolygonRegion(); this.m_Region.ID = info.GetInt32("m_ID"); this.m_Region.Name = info.GetString("m_Name"); this.m_Region.SelectedForPrint = info.GetBoolean("m_SelectedForPrint"); this.m_Region.GeoPolygonList = info.GetValue("m_GeoPolygonList", typeof(List<GeoPolygon>)) as List<GeoPolygon>; GeoPolygonStyle style = GeoEntityStyleFactory.GenerateDefaultPolygonStyle(); style.LineWidth = info.GetSingle("m_LineWidth"); style.LineDashStyle = (DashStyle) info.GetValue("m_LineType", typeof(DashStyle)); style.Color = (Color) info.GetValue("m_LineColor", typeof(Color)); style.FillColor = (Color) info.GetValue("m_RegionColor", typeof(Color)); style.Visible = info.GetBoolean("m_Visible"); style.IsShowLabel = info.GetBoolean("m_IsShownPolygonName"); base.m_Style = style; } else { base.BuildBaseClassFromV3R6(info, context); this.m_Region = info.GetValue("m_Region", typeof(GeoPolygonRegion)) as GeoPolygonRegion; } }
public UserCollection Generate(EnvTrafficMap map,int index, int scalingFactor, bool isFixure) { ITrafficMapModelService service = map.ServiceContext.Lookup(typeof(ITrafficMapModelService).FullName) as ITrafficMapModelService; IGeoPolygonAssist polygonRegionAssist = service.PolygonRegionAssist; this.InitRandom(isFixure); this.m_UserCollection = new UserCollection(); this.m_ScalingFactor = scalingFactor; foreach (GeoPolygonRegion region in map.PolygonRegionList) { try { this.m_Poly = this.getActuralPolyonRegion(polygonRegionAssist, region); this.m_Rect = this.m_Poly.GetMiniEnclosingRect(); foreach (UserMobilityBinding binding in map.PolygonEnvironmentBindings[region].UserDatas) { this.UserMobilityReader(index,binding, isFixure); } } catch (Exception exception) { WriteLog.Logger.Error(region.Name + " is not exist" + exception.Message); } } this.setUserIDProperty(); return this.m_UserCollection; }
public IEnumerable GetValidPointsValue(GeoPolygonRegion polygonRegion) { throw new NotImplementedException(); //<GetValidPointsValue>d__a _a = new <GetValidPointsValue>d__a(-2); //_a.<>4__this = this; //_a.<>3__polygonRegion = polygonRegion; //return _a; }
public PredictionBound GetBoundOfPolygon(GeoPolygonRegion polygon, float resolution) { PredictionBound bound = new PredictionBound(); bound.Left = polygon.Left; bound.Right = polygon.Right; bound.Bottom = polygon.Bottom; bound.Top = polygon.Top; this.GetBoundary(resolution, ref bound.Left, ref bound.Right, ref bound.Bottom, ref bound.Top); return bound; }
public ZoomInRegionOperator(IApplicationContext appContext, GeoEventManager eventMgr, GeoMapMgr geoMapMgr) { this.m_Helper = ServiceHelper.Lookup<IGeoSelectionHelper>(appContext); this.m_Cursor = new Cursor(Huawei.UNet.Common.GlobalResource.GlobalResource.ZoomIn.GetHicon()); this.m_EventMgr = eventMgr; this.m_GeoMapMgr = geoMapMgr; this.InitDrawingStyle(); this.m_StartPlanePoint = new GeoXYPoint(); this.m_SelectionPolygon = new GeoPolygon(); this.m_SelectionRegion = new GeoPolygonRegion(); this.m_SelectionRegion.AddGeoPolygon(this.m_SelectionPolygon); }
public List<Transceiver> GetCalculateCells(List<Transceiver> allLTECells, GeoPolygonRegion polygon, float resolution) { List<Transceiver> filterCell = new List<Transceiver>(); this.GetPolygonRectangle(polygon, resolution); foreach (Transceiver transceiver in allLTECells) { if (transceiver.Active) { this.GetOneCell(filterCell, transceiver); } } return filterCell; }
/// <summary> /// 生成Case计算时需要的数据类型 /// </summary> /// <param name="polygon">计算区域</param> /// <param name="cell">当前小区</param> /// <param name="resolution">精度</param> /// <returns>构造的数据类型</returns> public TranceiverCalcInfo GenTranceiverCalcInfo(GeoPolygonRegion polygon, IACell cell, float resolution) { double bottom, left, right, top; GetPolygonParameters(polygon, resolution, out bottom, out left, out right, out top); GeoXYPoint pointLeftTop = new GeoXYPoint(left, top); GeoXYPoint pointRightBottom = new GeoXYPoint(right, bottom); GeoXYPoint pointCell = CreatPoint(cell.Parent); //Tranceiver tranceiver = CreatPoint(cell.Parent); //pointCell.X = tranceiver.X; //pointCell.Y = tranceiver.Y; TranceiverCalcInfo calcInfo = ConstructCalcInfo(cell, resolution, pointLeftTop, pointRightBottom, pointCell, cell.Parent); return calcInfo; }
public MapClutterHelper(GeoPolygonRegion poly, IGeoPolygonAssist polyAssist, Dictionary<short, ClutterData> clutterDataDict, IApplicationContext appContext, bool isFixure) { this.m_ClutterAreaPercentDict = new Dictionary<short, double>(); this.m_ClutterPtsCntDict = new Dictionary<short, int>(); this.m_CluttersId = new List<short>(); this.m_ClutterWeightFactorDict = new Dictionary<short, double>(); this.m_ClutterDataDict = clutterDataDict; this.EventViewService = appContext.Lookup(typeof(IEventViewService).FullName) as IEventViewService; this.EventViewService.SetProgressScope(TrafficMapResource.TRAFFICMAP_GENUSER, 0, 100); this.m_ClutterPtsCntDict = polyAssist.GetClutterCountDict(poly, new SimulationProgressHandle(this.ReportProgrss), 5, 0x55, TrafficMapResource.TRAFFICMAP_GENUSER, !isFixure); this.EventViewService.ResetProgress(TrafficMapResource.TRAFFICMAP_GENUSER); this.GetClutterIDs(); this.GetClutterAreaPercentDict(); this.GetClutterWeightFactorDict(); }
/// <summary> /// 计算一个载波(ms高度默认为1.5米) /// </summary> /// <param name="context"></param> /// <param name="polygon"></param> /// <param name="resolution"></param> protected virtual void CalcOneCell(Context context, GeoPolygonRegion polygon, float resolution) { IACell cell = (IACell)context[ContextKeys.CurrentCalcCell]; Transceiver tranceiver = cell.Parent; CalculatorAssistant calAssistant = GetCalculatorAssistant(context); TranceiverCalcInfo cellInfo = calAssistant.GenTranceiverCalcInfo(polygon, cell, resolution); //TranceiverCalcInfo cellInfo = CalculatorAssistant.Instance.GenTranceiverCalcInfo(polygon, tranceiver, resolution); TrueFalseMatrix tfMatrix = (TrueFalseMatrix)context[ContextKeys.TFMatrix]; GetPointsHelper helper = new GetPointsHelper(cellInfo.StartPoint.X, cellInfo.StartPoint.Y, cellInfo.EndPoint.X, cellInfo.EndPoint.Y, tfMatrix); foreach (XYPoint point in helper.GetAllPoints()) { CalcOnePoint(point, cell); } }
private GeoPolygonRegion CreatRegion() { GeoPolygonRegion region = new GeoPolygonRegion(); GeoPolygon polygon = new GeoPolygon(); List<GeoXYPoint> point_list = new List<GeoXYPoint>(); GeoXYPoint fpoint = new GeoXYPoint(0, 0); point_list.Add(fpoint); GeoXYPoint spoint = new GeoXYPoint(0, 50); point_list.Add(spoint); GeoXYPoint tpoint = new GeoXYPoint(50, 0); point_list.Add(tpoint); GeoXYPoint lpoint = new GeoXYPoint(50, 50); point_list.Add(lpoint); polygon.Points = point_list; region.AddGeoPolygon(polygon); return region; }
private GeoPolygonRegion CreatRegion() { GeoPolygonRegion region=new GeoPolygonRegion(); GeoPolygon polygon=new GeoPolygon(); List<GeoXYPoint> point_list=new List<GeoXYPoint>(); GeoXYPoint fpoint=new GeoXYPoint(1000,2500); point_list.Add(fpoint); GeoXYPoint spoint=new GeoXYPoint(3000,1000); point_list.Add(spoint); GeoXYPoint tpoint=new GeoXYPoint(3800,4000); point_list.Add(tpoint); GeoXYPoint lpoint=new GeoXYPoint(2200,4500); point_list.Add(lpoint); polygon.Points=point_list; region.AddGeoPolygon(polygon); return region; }
private void CalcOneLineXDatas(GeoCalcBound geoCalcBound, double tempX, double tempY, GeoPolygonRegion polygonRegion, short[] valueArray) { for (int i = 0; i < geoCalcBound.RectColumns; i++) { tempX = geoCalcBound.Left + (geoCalcBound.CalcWidth * i); if (this.m_CaculateFullMap || polygonRegion.IsPointInRegion(new GeoXYPoint(tempX, tempY))) { int indexOffsetIsCalcWidthMulti = geoCalcBound.GetIndexOffsetIsCalcWidthMulti(tempX, tempY); short key = valueArray[indexOffsetIsCalcWidthMulti]; if (this.m_ClutterIDCountDict.ContainsKey(key)) { Dictionary<short, int> dictionary; short num4; (dictionary = this.m_ClutterIDCountDict)[num4 = key] = dictionary[num4] + 1; } } } }
public LTECalcCellsInfoCollection GetCalculateCellsInfo(List<Transceiver> allLTECells, GeoPolygonRegion polygon, float resolution) { LTECalcCellsInfoCollection cellsInfo = new LTECalcCellsInfoCollection(); this.GetPolygonRectangle(polygon, resolution); bool flag = false; foreach (Transceiver transceiver in allLTECells) { foreach (IACell cell in transceiver.Cells) { flag |= !float.IsNegativeInfinity((cell as LTECell).DlActualTxPower); } if ((transceiver.Active & flag) & (this.m_GeoInfo.GetValueByGeoXYPoint(transceiver.Parent.X, transceiver.Parent.Y, DemDataType.Height) > -32768)) { this.GetOneCellInfo(resolution, cellsInfo, transceiver); } flag = false; } return cellsInfo; }
private GeoPolygonAssist() { this.m_IsNeedReportProgress = false; this.m_ProgressStart = 0; this.m_ProgressEnd = 0; this.m_ProgressStr = null; this.m_HasAllMapCalc = false; this.m_IsClutterPercentRun = false; this.m_AreaRatio = 1.0; this.clutterIDPointInRectDict = new Dictionary<short, List<GeoXYPoint>>(); this.m_GeoPolygon = new Huawei.UNet.GIS.GeoInterface.GeoPolygon(); this.m_PolygonRegion = new GeoPolygonRegion(); this.m_ClutterIDCountDict = new Dictionary<short, int>(); this.m_ClutterIDIndexDict = new Dictionary<short, List<int>>(); this.m_ClutterIDPercentDict = new Dictionary<short, double>(); this.m_AllMapClutterIDPercentDict = new Dictionary<short, double>(); this.m_InvalidMaxMin = new MaxMinValue(); this.m_InvalidMaxMin.max = float.MaxValue; this.m_InvalidMaxMin.min = float.MinValue; }
public LTETransceiverExCollection GetCalculateTransceiverInfo(ref List<Transceiver> allTran, GeoPolygonRegion polygon, float resolution) { LTETransceiverExCollection transceiverColl = new LTETransceiverExCollection(); //得到多边形的外接矩形 this.GetPolygonRectangle(polygon, resolution); bool flag = false; short i = (short)allTran.Count; List<Transceiver> allTransTemp = new List<Transceiver>(); allTransTemp.AddRange(allTran); foreach (Transceiver transceiver in allTransTemp) { foreach (IACell cell in transceiver.Cells) { if (cell is LTECell) { LTECell lteCell = (LTECell)cell; if (lteCell.RNList.Count > 0) { foreach (RelayNode rn in lteCell.RNList) { // i++; GetOneRelayTransInfo(ref allTran, resolution, ref transceiverColl, rn, i); } } flag |= !float.IsNegativeInfinity((cell as LTECell).DlActualTxPower); } } if ((transceiver.Active & flag) & (this.m_GeoInfo.GetValueByGeoXYPoint(transceiver.Parent.X, transceiver.Parent.Y, DemDataType.Height) > -32768)) { this.GetOneTransInfo(resolution, ref transceiverColl, transceiver); } flag = false; } allTransTemp.Clear(); return transceiverColl; }
private void AddClutterOnPolygon(GeoPolygonRegion Polygon, List<ClutterEntity> Clutters, Dictionary<short, double> ClutterAreaMap, Dictionary<short, int> ClutterPoints) { foreach (KeyValuePair<short, double> pair in ClutterAreaMap) { if (pair.Value > 0.0) { ClutterEntity entity; //entity = new ClutterEntity { // Id = pair.Key, // Area = Polygon.RegionArea * pair.Value, // PointCount = ClutterPoints[entity.Id], // Name = this.m_ClutterInfo[entity.Id] //}; entity = new ClutterEntity(); entity.Id = pair.Key; entity.Area = Polygon.RegionArea * pair.Value; entity.PointCount = ClutterPoints[entity.Id]; entity.Name = this.m_ClutterInfo[entity.Id]; Clutters.Add(entity); } } }
private GeoPolygonRegion GetCalculationRegion(GeoPolygonRegion m_CalculationPolyRegion, GeoPolygonRegion polygon) { if (polygon.Name == GeneralResource.GENERAL_FULL_MAP) { m_CalculationPolyRegion = polygon; } foreach (GeoPolygonRegion region in this.m_otherSubSysInterface.IGis.GeoProvider.PolygonRegionList) { if (region.ID == polygon.ID) { m_CalculationPolyRegion = region; return m_CalculationPolyRegion; } } return m_CalculationPolyRegion; }
public void AddPolygonRegion(GeoPolygonRegion polygon, GeoPolygonStyle polygonStyle) { Dictionary<GeoPolygonRegion, GeoPolygonStyle> polygons = new Dictionary<GeoPolygonRegion, GeoPolygonStyle>(); polygons.Add(polygon, polygonStyle); this.AddPolygonRegions(polygons); }
public Feature GetFeatureByRegion(GeoPolygonRegion region, string featureName) { throw new NotImplementedException(); }
private void GetPolygonParameters(GeoPolygonRegion polygon, float resolution, out double bottom, out double left, out double right, out double top) { bottom = polygon.Bottom; left = polygon.Left; right = polygon.Right; top = polygon.Top; right = Convert.ToInt32(Math.Ceiling(right - left) / resolution) * resolution + left; bottom = -Convert.ToInt32(Math.Ceiling(top - bottom) / resolution) * resolution + top; }
private void ReadPolygon(int numParts, int numPoints) { int[] numArray = new int[numParts]; for (int i = 0; i < numParts; i++) { numArray[i] = this.ReadInteger(ByteOrder.LittleEndian); } int index = 1; GeoPolygon geoPolygon = new GeoPolygon(); for (int j = 0; j < numPoints; j++) { double x = this.ReadDouble(ByteOrder.LittleEndian); double y = this.ReadDouble(ByteOrder.LittleEndian); GeoXYPoint point = new GeoXYPoint(x, y); if (index < numParts) { if (j < numArray[index]) { geoPolygon.Points.Add(point); } else { GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); GeoDisplayPolygonRegion region2 = new GeoDisplayPolygonRegion(region, this.m_DefaultPolygonStyle); index++; } } else { geoPolygon.Points.Add(point); } } GeoPolygonRegion region3 = new GeoPolygonRegion(); region3.AddGeoPolygon(geoPolygon); GeoDisplayPolygonRegion item = new GeoDisplayPolygonRegion(region3, this.m_DefaultPolygonStyle); item.AddFeature("ID", this.CreateMapUnitId()); this.m_RegionList.Add(item); }
public UMTSPredictionGroup() { StudyList = new List<IStudy>(); ServiceList = new List<Service>(); //m_Terminal = new Terminal(); PloygonList = new List<GeoPolygonRegion>(); UIParam = new UMTSCovUIParam(); //m_CsService = new UnionCsService(); //m_PsService = new UnionPsService(); Region = new GeoPolygonRegion(); }
public GeoPolygonRegion GetRegionRectangle(GeoPolygonRegion polygon, float resolution) { this.GetPolygonRectangle(polygon, resolution); GeoXYRect geoXYRect = new GeoXYRect(this.m_polygonLeftTop.X, this.m_polygonRightBottom.X, this.m_polygonRightBottom.Y, this.m_polygonLeftTop.Y); GeoPolygon geoPolygon = new GeoPolygon(geoXYRect); GeoPolygonRegion region = new GeoPolygonRegion(); region.AddGeoPolygon(geoPolygon); return region; }
private void GetPolygonRectangle(GeoPolygonRegion polygon, float resolution) { double bottom = polygon.Bottom; double left = polygon.Left; double right = polygon.Right; double top = polygon.Top; if ((left % ((double) resolution)) != 0.0) { left -= left % ((double) resolution); } if ((top % ((double) resolution)) != 0.0) { top += resolution - (top % ((double) resolution)); } if ((right % ((double) resolution)) != 0.0) { right += resolution - (right % ((double) resolution)); } if ((bottom % ((double) resolution)) != 0.0) { bottom -= bottom % ((double) resolution); } this.m_polygonColumns = Convert.ToInt32((double) ((right - left) / ((double) resolution))); this.m_polygonRows = Convert.ToInt32((double) ((top - bottom) / ((double) resolution))); this.m_polygonLeftTop.X = left; this.m_polygonLeftTop.Y = top; this.m_polygonRightBottom.X = right; this.m_polygonRightBottom.Y = bottom; }
private void SelectValidUserByCalculationRegion(GeoPolygonRegion m_CalculationPolyRegion, List<User> snapshotUsers, List<User> trafficUsers) { GeoXYPoint geoXYPoint = new GeoXYPoint(); foreach (User user in trafficUsers) { geoXYPoint.X = user.X; geoXYPoint.Y = user.Y; //如果用户在计算范围内则为用户配置属性 //如果用户的IsCalculatInPolygon字段为true,则表示已分配好终端、服务等,不需要重新配置 if (!(!m_CalculationPolyRegion.IsPointInRegion(geoXYPoint) || user.IsCalculatInPolygon)) { user.Terminal = this.m_CloneTerminalDic[user.Terminal.Name]; user.Service = this.m_CloneServiceDic[user.Service.Name]; user.Mobility = this.m_CloneMobilityDic[user.Mobility.Name]; user.IsCalculatInPolygon = true; snapshotUsers.Add(user); } } }
public bool GetCellCollection() { List<Transceiver> tranceiverList = this.m_otherSubSysInterface.INet.TranceiverList; try { foreach (GeoPolygonRegion region in this.m_param.PolygonList) { foreach (GeoPolygon polygon in region.GetAllPolygon()) { List<Transceiver> list2 = new List<Transceiver>(); GeoPolygonRegion region2 = new GeoPolygonRegion(); region2.AddGeoPolygon(polygon); list2 = this.m_otherSubSysInterface.CellFilterBuilder.GetCellFilter().GetCalculateCells(tranceiverList, region2, 10f); foreach (Transceiver transceiver in list2) { if (!this.m_calcCells.Contains(transceiver)) { this.m_calcCells.Add(transceiver); } } } } } catch (Exception exception) { this.m_otherSubSysInterface.EventViewService.WriteLog(SimulationResource.SIMULATION_THE_WRONG_IS + exception.Message.ToString(), Huawei.UNet.Frame.Interface.LogLevel.Error); return false; } return true; }
public List<Transceiver> GetTranceiverList(GeoPolygonRegion region, List<Transceiver> allTranceiverList, float resolution) { List<Transceiver> copy = new List<Transceiver>(); foreach (var item in allTranceiverList) { if (item.Cells[0] is LTECell) { copy.Add(item); } } List<Transceiver> list = new List<Transceiver>(); PredictionBound boundOfPolygon = this.GetBoundOfPolygon(region, resolution); foreach (Transceiver transceiver in copy) { if (transceiver.Active && this.IsTranceiverInCalcZone(boundOfPolygon, transceiver)) { list.Add(transceiver); } } return list; }
private List<User> GenUsers(int snapshotid) { GeoPolygonRegion calculationRegion = new GeoPolygonRegion(); List<User> snapshotUsers = new List<User>(); try { lock (this.m_GenUserLocker) { List<ITrafficMap> trafficMaps = new List<ITrafficMap>(); this.GetTrafficMapList(trafficMaps); List<User> trafficUsers = new List<User>(); GeoXYPoint point = new GeoXYPoint(0.0, 0.0); foreach (ITrafficMap map in trafficMaps) { trafficUsers = map.GenerateUsers(this.m_param.ScalingFactor, this.m_param.IsFixure); foreach (GeoPolygonRegion region2 in this.m_param.PolygonList) { calculationRegion = this.GetCalculationRegion(calculationRegion, region2); this.SelectValidUserByCalculationRegion(calculationRegion, snapshotUsers, trafficUsers); } } int num = 0; foreach (User user in snapshotUsers) { user.Id = num; num++; } return snapshotUsers; } } catch (ThreadAbortException exception) { this.m_otherSubSysInterface.ResetProgress(SimulationResource.SIMULATION_GEN_USER); throw exception; } catch (Exception exception2) { snapshotUsers.Clear(); this.m_otherSubSysInterface.ResetProgress(SimulationResource.SIMULATION_GEN_USER); throw new Exception(SimulationResource.SIMULATION_GEN_USER_FAIL + " \n", exception2); } return snapshotUsers; }