// 多场景校正系数
        public double[] calcRayStrengthAdj(double rayAzimuth, double rayInclination, ref List <NodeInfo> rays)
        {
            //计算发射功率p0
            double dbmPt = calcDbmPt(rayAzimuth, rayInclination);  //定向

            if (rays.Count > 0 && cellInfo.SourcePoint.Z < 1.1)
            {
                dbmPt = cellInfo.EIRP;
            }
            double wPt = convertdbm2w(dbmPt);

            //获得校正系数矩阵
            double[,] coef = AdjCoeffHelper.getInstance().getCoeff();

            //计算接收功率
            RayInfo rayInfo = new RayInfo(rays, wPt);

            rayInfo.calcRecePwrW(ref coef, this.scenNum, cellInfo.frequncy);

            double[] ret = new double[3];
            ret[0] = rayInfo.recePwrW;
            ret[1] = rayInfo.distance;
            ret[2] = wPt;
            return(ret);
        }
예제 #2
0
        public CalcGridStrength(CellInfo sourceInfo)
        {
            this.cellInfo = sourceInfo;

            maxDistGround = 0;
            maxDistBuild  = 0;
            scenNum       = AdjCoeffHelper.getInstance().getSceneNum();
        }
예제 #3
0
        public CalcGridStrength(CellInfo sourceInfo, Dictionary <string, GridStrength> gs)
        {
            this.cellInfo      = sourceInfo;
            this.gridStrengths = gs;

            maxDistGround = 0;
            maxDistBuild  = 0;
            scenNum       = AdjCoeffHelper.getInstance().getSceneNum();
        }
예제 #4
0
 public static AdjCoeffHelper getInstance()
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             if (instance == null)
             {
                 instance = new AdjCoeffHelper();
                 Init();
             }
         }
     }
     return(instance);
 }
예제 #5
0
        // 多场景校正系数
        public double[] calcRayStrengthAdj(double rayAzimuth, double rayInclination, ref List <NodeInfo> rays)
        {
            //计算dbmPt
            double[] ret = new double[3];

            double distance   = 0;
            double reflectedR = 1; //反射系数
            double diffrctedR = 1; //绕射系数

            double[,] coef = AdjCoeffHelper.getInstance().getCoeff();

            double nata = 0;

            if (cellInfo.cellType == CellType.GSM1800)
            {
                //f(n) = 1805 + 0.2*(n-511) MHz
                nata = 300.0 / (1805 + 0.2 * (cellInfo.frequncy - 511));
            }
            else
            {
                //f(n) = 935 + 0.2n MHz
                nata = 300.0 / (935 + 0.2 * cellInfo.frequncy);
            }

            double dbmPt = calcDbmPt(rayAzimuth, rayInclination);  //定向

            if (rays.Count > 0 && cellInfo.SourcePoint.Z < 1.1)
            {
                dbmPt = cellInfo.EIRP;
            }

            double wPt = convertdbm2w(dbmPt);

            int      length = rays.Count;
            NodeInfo ray;

            double[] scenDistance = new double[this.scenNum];

            for (int i = 0; i < length; i++)
            {
                ray = rays[i];

                // 当前射线经过每个场景的距离
                string[] scenArr = ray.proportion.Split(';');
                for (int j = 0; j < this.scenNum; j++)
                {
                    scenDistance[j] += Convert.ToDouble(scenArr[j]) * ray.Distance;
                }

                distance += ray.Distance;
                if (ray.rayType == RayType.HReflection || ray.rayType == RayType.VReflection) //反射
                {
                    //反射系数是平方后的结果?todo
                    // 弧度
                    ray.attenuation = reflectCoefficient(ray.Angle) * coef[ray.endPointScen, 1]; // 用于系数校正
                    reflectedR     *= ray.attenuation;
                }
                else if (ray.rayType == RayType.HDiffraction || ray.rayType == RayType.VDiffraction) //绕射
                {
                    ray.attenuation = diffractCoefficient(ray.Angle) * coef[ray.endPointScen, 2];    // 用于系数校正
                    diffrctedR     *= ray.attenuation;
                }
                else
                {
                    ray.attenuation = 1;
                }
                //透射另行计算
            }

            double amendDirSum = 0;

            for (int j = 0; j < scenNum; j++)
            {
                amendDirSum += coef[j, 0] * (scenDistance[j] / distance);
            }

            double receivePwr = 0;

            receivePwr = Math.Pow(nata / (4 * Math.PI), 2) * (wPt / Math.Pow(distance, (2 + amendDirSum))) * Math.Pow(reflectedR, 2) * Math.Pow(diffrctedR, 2);
            ret[0]     = receivePwr;
            ret[1]     = distance;
            ret[2]     = wPt;
            return(ret);
        }