Ejemplo n.º 1
0
 /// <summary>
 /// 供计算点路损时使用
 /// </summary>
 /// <param name="structAntennaParam"></param>
 /// <param name="peakTempValue"></param>
 public void ConvertPolarToXY(StructAntennaParam structAntennaParam, PeakTempValue peakTempValue)
 {
     if (peakTempValue.PeakDot != 0)
     {
         float horizonAzimuth = CalculateHorizontalAzimuth(structAntennaParam.CellX, structAntennaParam.CellY, structAntennaParam.MsX, structAntennaParam.MsY);
         float distanceFromTxToPeak = peakTempValue.PeakDot * peakTempValue.Resolution;
         TransPolarToXYHelper(structAntennaParam, horizonAzimuth, distanceFromTxToPeak);
     }
 }
Ejemplo n.º 2
0
 private double CalcAntGain3D(LTECell carrier, User user)
 {
     Transceiver parent = carrier.Parent;
     StructAntennaParam calAntennaParam = new StructAntennaParam();
     calAntennaParam.AntConfigSetUp = parent.AntConfiguration[0];
     calAntennaParam.CellX = parent.X;
     calAntennaParam.CellY = parent.Y;
     calAntennaParam.IsSimple = false;
     calAntennaParam.MsX = user.X;
     calAntennaParam.MsY = user.Y;
     calAntennaParam.AntHeight = 0;
     calAntennaParam.MsHeight = 0;
     return (double) this.m_CalculateGain.CalculateAntennaGain(calAntennaParam);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 供计算射线路损时使用
        /// </summary>
        /// <param name="transceiverPathLossMatrix"></param>
        /// <param name="structAntennaParam"></param>
        /// <param name="rowIndex"></param>
        /// <param name="colIndex"></param>
        public void ConvertPolarToXY(TransceiverPathLossMatrix transceiverPathLossMatrix, StructAntennaParam structAntennaParam, int rowIndex, int colIndex)
        {

            double cellX = structAntennaParam.CellX;
            double cellY = structAntennaParam.CellY;
            double msX = structAntennaParam.MsX;
            double msY = structAntennaParam.MsY;

            //得到正北方向下移动台水平方位角
            float horizonAzimuth = CalculateHorizontalAzimuth(structAntennaParam.CellX, structAntennaParam.CellY, structAntennaParam.MsX, structAntennaParam.MsY);

            //得到移动台和基站连线的索引值
            int rayIndex = CalculateRayIndex(structAntennaParam, horizonAzimuth, transceiverPathLossMatrix, colIndex, rowIndex);

            //得到移动台至基站的距离
            float distanceFromRxToTx = (float)Math.Sqrt((cellX - msX) * (cellX - msX) + (cellY - msY) * (cellY - msY));

            if (distanceFromRxToTx < transceiverPathLossMatrix.Radius)
            {
                //得到移动台在PeakDot矩阵中的相对位置
                int dotMsIndex = (int)Math.Floor(distanceFromRxToTx / transceiverPathLossMatrix.Resolution);
                if (dotMsIndex == (int)Math.Floor(transceiverPathLossMatrix.Radius / transceiverPathLossMatrix.Resolution))//防止溢出
                {
                    dotMsIndex -= 1;
                }

                //得到一条射线上采样点的个数
                int rayDotNum = (int)(transceiverPathLossMatrix.Radius / transceiverPathLossMatrix.Resolution);

                //得到移动台在dot矩阵中的绝对位置
                int absDotMsIndex = rayIndex * rayDotNum + dotMsIndex;

                //取出该点存储的障碍物位置
                int peakDotIndex = transceiverPathLossMatrix.PeakDotMatrix[absDotMsIndex];

                if (peakDotIndex != 0)
                {
                    //得到障碍物和基站之间的距离
                    float distanceFromTxToPeak = peakDotIndex * transceiverPathLossMatrix.Resolution;

                    //取出该点存储障碍物的高度
                    short peakHeight = transceiverPathLossMatrix.PeakHeightMatrix[absDotMsIndex];

                    structAntennaParam.MsHeight = peakHeight;

                    TransPolarToXYHelper(structAntennaParam, horizonAzimuth, distanceFromTxToPeak);

                }
            }
        }
Ejemplo n.º 4
0
 public LinkLoss(CalLinkLossParam calParam, IApplicationContext appContex)
 {
     this.m_clutterParams = calParam.clutterParams;
     this.m_GeoInfo = calParam.geoInfo;
     this.m_antGainCal = calParam.antGainCal;
     this.m_iplCalDataVstr = calParam.iplCalDataVstr;
     this.m_IsBuildingLoaded = calParam.IsBuildingLoaded;
     this.m_StructAntennaParam = new StructAntennaParam();
     this.m_DicOfParamsFromGIS = new Dictionary<short, ParamsFromGIS>();
     this.AddDictionary(calParam.CellEdgeCoverageProbability);
     LinkLossConfiguration configuration = new LinkLossConfiguration(appContex);
     this.m_Layers = configuration.ReaderLayers();
     this.m_MCL = configuration.GetMCL();
     //add by xujuan
     m_iGetRelayUEPathLoss = calParam.iGetRelayUEPathLoss;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 计算宏小区到relay的天线增益
        /// </summary>
        /// <param name="lteCell"></param>
        /// <param name="relayCell"></param>
        /// <returns></returns>
        private float CalcAntGain(LTECell lteCell, RelayCell relayCell)
        {
            StructAntennaParam calAntennaParam = new StructAntennaParam();
            int sectorID = lteCell.Parent.AntConfiguration[0].AntennaID;
            calAntennaParam.CellX = lteCell.Parent.Parent.X + lteCell.Parent.GetAntConfig(sectorID).DX;
            calAntennaParam.CellY = lteCell.Parent.Parent.Y + lteCell.Parent.GetAntConfig(sectorID).DY;
            calAntennaParam.IsSimple = false;
            calAntennaParam.AntHeight = m_IGeoInfo.GetValueByGeoXYPoint(calAntennaParam.CellX, calAntennaParam.CellY, DemDataType.Height);

            calAntennaParam.MsX = relayCell.ParentRN.X;//todo:加上偏置?
            calAntennaParam.MsY = relayCell.ParentRN.Y;
            calAntennaParam.MsHeight = m_IGeoInfo.GetValueByGeoXYPoint(relayCell.ParentRN.X, relayCell.ParentRN.Y, DemDataType.Height);
            float antGain = 0;
            calAntennaParam.AntConfigSetUp = lteCell.Parent.GetAntConfig(sectorID);
            antGain = m_AntennaGainCalculator.Calculate3DGain(calAntennaParam);
            return antGain;
        }
Ejemplo n.º 6
0
 public float CalculateElevation(StructAntennaParam calAntennaParam, float msAzimuth, float msElevation, float azimuth, float antAzimuth, float antTilt, float antETilt)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public float Calculate3DGain(StructAntennaParam calAntennaParam, float DLStartFrequency)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 8
0
 public float Calculate3DGain(StructAntennaParam calAntennaParam)
 {
     return 10f;
 }
Ejemplo n.º 9
0
 private double GetAntnnaGain(StructAntennaParam structAntParam)
 {
     return (double) this.m_antGainCal.Calculate3DGain(this.m_StructAntennaParam);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 获取backhaul单点路损
 /// </summary>
 /// <param name="trans"></param>
 /// <param name="cellID"></param>
 /// <param name="sectorID"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="resolution"></param>
 /// <param name="isGetAntGain"></param>
 /// <returns></returns>
 private float[][] GetOnePointBackhaulPathLoss(Transceiver trans, short cellID, int sectorID, double x, double y, float resolution, bool isGetAntGain)
 {
     float[][] pathLossMatrix = new float[][] { new float[2] };
     if (this.m_PathLossCellData.TransBackhaulPathLossMatrixList.Count != 0)
     {
         TransceiverPathLossMatrix transceiverPathLossMatrix = FindBackhaulMatrix(sectorID, cellID);
         if ((transceiverPathLossMatrix == null) || this.RangeXY(x, y, transceiverPathLossMatrix))
         {
             pathLossMatrix[0][0] = float.MinValue;
             pathLossMatrix[0][1] = float.MinValue;
             return pathLossMatrix;
         }
         double distance = this.GetDistance(trans, sectorID, x, y);
         int xIndex = (int)((x - transceiverPathLossMatrix.LeftTopX) / ((double)transceiverPathLossMatrix.Resolution));
         int yIndex = (int)((transceiverPathLossMatrix.LeftTopY - y) / ((double)transceiverPathLossMatrix.Resolution));
         int delayIndex = this.GetDelayIndex(xIndex, yIndex, transceiverPathLossMatrix);
         if (this.IsMatixInvalid(transceiverPathLossMatrix, delayIndex))
         {
             pathLossMatrix[0][1] = float.MinValue;
             pathLossMatrix[0][0] = float.MinValue;
         }
         else if (this.IsUsingMatrixs(x, y, resolution, transceiverPathLossMatrix))
         {
             float deltaLoss = GetBackhaulDeltaLoss(trans, x, y, distance);
             GetExistsPLMatrix(isGetAntGain, pathLossMatrix, transceiverPathLossMatrix, delayIndex, deltaLoss);
         }
         else
         {
             StructAntennaParam calAntennaParam = new StructAntennaParam();
             calAntennaParam.CellX = trans.Parent.X + trans.GetAntConfig(sectorID).DX;
             calAntennaParam.CellY = trans.Parent.Y + trans.GetAntConfig(sectorID).DY;
             calAntennaParam.IsSimple = false;
             calAntennaParam.AntHeight = this.m_IGeoInfo.GetValueByGeoXYPoint(calAntennaParam.CellX, calAntennaParam.CellY, DemDataType.Height);
             //用户的坐标
             calAntennaParam.MsX = x;
             calAntennaParam.MsY = y;
             calAntennaParam.MsHeight = this.m_IGeoInfo.GetValueByGeoXYPoint(x, y, DemDataType.Height);
             float num6 = transceiverPathLossMatrix.LeftTopX + (xIndex * transceiverPathLossMatrix.Resolution);
             float dX = (float)((x - num6) / ((double)transceiverPathLossMatrix.Resolution));
             float num8 = transceiverPathLossMatrix.LeftTopY - (yIndex * transceiverPathLossMatrix.Resolution);
             float dY = (float)((num8 - y) / ((double)transceiverPathLossMatrix.Resolution));
             pathLossMatrix[0][1] = this.getPathLossByWeight(xIndex, yIndex, dX, dY, transceiverPathLossMatrix);
             float antGain = 0f;
             if (isGetAntGain)
             {
                 calAntennaParam.AntConfigSetUp = trans.GetAntConfig(sectorID);
                 antGain = this.m_AntennaGainCalculator.Calculate3DGain(calAntennaParam);
             }
             this.SetBackhaulMatrix(pathLossMatrix, x, y, trans, antGain, distance);
         }
     }
     return pathLossMatrix;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 得到移动台和基站连线的索引值
        /// </summary>
        /// <param name="structAntennaParam"></param>
        /// <param name="horizonAzimuth"></param>
        /// <param name="transceiverPathLossMatrix"></param>
        /// <param name="colIndex"></param>
        /// <param name="rowIndex"></param>
        /// <returns></returns>
        private int CalculateRayIndex(StructAntennaParam structAntennaParam, float horizonAzimuth, TransceiverPathLossMatrix transceiverPathLossMatrix, int colIndex, int rowIndex)
        {
            int rayIndex = 0;
            double absHorizonAzimuth = 0;

            //float offset = ConvRadianToAngle(transceiverPathLossMatrix.Offset);
            float offset = (transceiverPathLossMatrix.Offset);


            #region 坐标转换 X轴正方向为正,逆时针旋转

            if (structAntennaParam.MsX < structAntennaParam.CellX)//左半平面
            {
                //基站和移动台的相对夹角
                absHorizonAzimuth = Math.PI + horizonAzimuth;

            }
            else//右半平面
            {
                //基站和移动台的相对夹角
                absHorizonAzimuth = (Math.PI * 2 + horizonAzimuth) % (Math.PI * 2);
            }

            //得到射线索引
            rayIndex = (int)(absHorizonAzimuth / offset);

            //防止溢出
            if (rayIndex == (int)(Math.PI * 2 / offset))
                rayIndex -= 1;

            return rayIndex;

            #endregion
        }
Ejemplo n.º 12
0
 /// <summary>
 /// 转换辅助方法 得到替换点的坐标
 /// </summary>
 /// <param name="structAntennaParam"></param>
 /// <param name="horizonAzimuth"></param>
 /// <param name="distanceFromTxToPeak"></param>
 private void TransPolarToXYHelper(StructAntennaParam structAntennaParam, float horizonAzimuth, float distanceFromTxToPeak)
 {
     if (structAntennaParam.MsX < structAntennaParam.CellX)//左半部分栅格
     {
         structAntennaParam.MsX = structAntennaParam.CellX - distanceFromTxToPeak * Math.Cos(horizonAzimuth);
         structAntennaParam.MsY = structAntennaParam.CellY - distanceFromTxToPeak * Math.Sin(horizonAzimuth);
     }
     else //右半部分栅格
     {
         structAntennaParam.MsX = structAntennaParam.CellX + distanceFromTxToPeak * Math.Cos(horizonAzimuth);
         structAntennaParam.MsY = structAntennaParam.CellY + distanceFromTxToPeak * Math.Sin(horizonAzimuth);
     }
 }