public void MyTestInitialize()
        {
            User lteuser = new User();
            m_User = new SimulationUser();
            m_Carrier = new SimulationCarrier();
            m_Carrier.AdmissionCarrierTag = new AdmissionCellTag();
            m_DlAdmission = new DlAdmissionControl();
            m_ISimulationCarrierList = new List<ISimulationCarrier>();
            

            SimulationCarrier carrier1 = new SimulationCarrier();
            m_ISimulationCarrierList.Add(carrier1);
            carrier1.DlUserList.Add(m_User);
            carrier1.DLHandOverDataUserList.Add(m_User);
            carrier1.DLHandOverVoiceUserList.Add(m_User);
            m_User.LTEUser = lteuser;

            m_GBRUserList = new List<ISimulationUser>();
            m_NonGBRUserList = new List<ISimulationUser>();
            
            SimulationUser user1 = new SimulationUser();
            m_GBRUserList.Add(user1);
            m_NonGBRUserList.Add(user1);
            //m_Carrier.DlVoiceWaitUserList.Add(m_User);

            

        }
Example #2
0
 /// <summary>
 /// 把用户加到各自的最佳服务小区的上行或下行用户列表中
 /// </summary>
 /// <param name="user"></param>
 /// <param name="DlRsrpFailUserList"></param>
 /// <param name="UlRsrpFailUserList"></param>
 private void addUserToList(SimulationUser user, List<User> DlRsrpFailUserList, List<User> UlRsrpFailUserList)
 {
     if ((user.DlRsrp >= SimulationConstant.DLRSRP_ACCESS_THRESHOLD) && 
         (user.UlRsLevel >= SimulationConstant.ULRSRP_ACCESS_THRESHOLD))
     {
         if (user.LTEUser.LinkType == LinkType.Uplink)
         {
             user.BestServiceCarrier.UlUserList.Add(user);
         }
         else
         {
             user.BestServiceCarrier.DlUserList.Add(user);
         }
         user.State = State.NewAccess;
     }
     else if (user.DlRsrp >= SimulationConstant.DLRSRP_ACCESS_THRESHOLD)
     {
         user.FailReason = FailReason.UlRsrpFail;
         user.State = State.NoCover;
         UlRsrpFailUserList.Add(user.LTEUser);
     }
     else
     {
         user.FailReason = FailReason.DlRsrpFail;
         user.State = State.NoCover;
         DlRsrpFailUserList.Add(user.LTEUser);
     }
 }
Example #3
0
 private void CalculateLinkInfo(SimulationUser user, MonteCarloSnapResult snapResult, int start, int end)
 {
     float ulAveThroughputDemand;
     float num2;
     float num3;
     bool flag = this.m_UserHelper.IsUp(user.LTEUser);
     UnionPsService unionPsService = SimulationTools.GetUnionPsService(user.LTEUser.Service);
     if (flag)
     {
         ulAveThroughputDemand = unionPsService.UlAveThroughputDemand;
         num2 = user.UserUlTotalThroughput / ((float) ((end - start) + 1));
         num3 = user.UserUlAppTotalThroughput / ((float) ((end - start) + 1));
         snapResult.AllUlActualThroughput += num2;
         snapResult.AllUlActualAppThroughput += num3;
         snapResult.AllUlMaxThroughputDemand += unionPsService.UlMaxThroughputDemand;
         snapResult.AllUlMinThroughputDemand += unionPsService.UlMinThroughputDemand;
         snapResult.AllUlAvgThroughputDemand += ulAveThroughputDemand;
     }
     else
     {
         ulAveThroughputDemand = unionPsService.DlAveThroughputDemand;
         num2 = user.UserDlTotalThroughput / ((float) ((end - start) + 1));
         num3 = user.UserDlAppTotalThroughput / ((float) ((end - start) + 1));
         snapResult.AllDlActualThroughput += num2;
         snapResult.AllDlActualAppThroughput += num3;
         snapResult.AllDlMaxThroughputDemand += unionPsService.DlMaxThroughputDemand;
         snapResult.AllDlMinThroughputDemand += unionPsService.DlMinThroughputDemand;
         snapResult.AllDlAvgThroughputDemand += ulAveThroughputDemand;
     }
 }
Example #4
0
 private string GetUserMIMOType(SimulationUser user, OtherSubSysInterface subSysInterface)
 {
     if (subSysInterface != null)
     {
         return UserManager.getInstance().GetMIMOType(subSysInterface, user).Name;
     }
     return string.Empty;
 }
Example #5
0
 private float GetUserPdschSinr(SimulationUser user)
 {
     if (float.IsNaN(user.PdschSinr))
     {
         return user.DlInitRsSinr;
     }
     return (user.WarmUpTotalPdschSinr / ((float) user.DlIoTCount));
 }
Example #6
0
 private float GetUserPuschSinr(SimulationUser user)
 {
     if (float.IsNaN(user.PuschSinr))
     {
         return user.DlInitRsSinr;
     }
     return (user.WarmUpTotalPuschSinr / user.UlSinrCounter);
 }
Example #7
0
        /// <summary>
        /// 找到用户的最佳服务小区
        /// </summary>
        /// <param name="user"></param>
        /// <param name="rsrpValue">满足门限要求的,key:小区,value:该用户到该小区的下行参考信号接收功率</param>
        private void findBestServiceCell(SimulationUser user, Dictionary<SimulationCarrier, float> rsrpValue)
        {
            float maxDlrsPowerTemp = float.MinValue;
            float ulrsPower = float.MinValue;
            float dlrsPowerTemp = 0f;
            float ulrsPowerTemp = 0f;
            SimulationCarrier key = null;
            float dlTotalLoss = 0f;
            float ulTotalLoss = 0f;
            int index = -1;
            for (int i = 0; i < user.CarrierListInComputeArea.Length; i++)
            {
                CarrierTotalLoss loss = user.CarrierListInComputeArea[i];
                SimulationCarrier carrier = loss.Carrier;
                dlTotalLoss = loss.DlTotalLoss;
                ulTotalLoss = loss.UlTotalLoss;
                //下行参考信号接收功率
                dlrsPowerTemp = SimulationTools.ConvertLineTodB(carrier.RsRePower / dlTotalLoss);
                ulrsPowerTemp = SimulationTools.ConvertLineTodB((user.LTEUser.Terminal.NetTerminalList[0].MaxTxPower / 12f) / ulTotalLoss);
                if ((dlrsPowerTemp >= SimulationConstant.DLRSRP_ACCESS_THRESHOLD) && 
                    (ulrsPowerTemp >= SimulationConstant.ULRSRP_ACCESS_THRESHOLD))
                {
                    if (maxDlrsPowerTemp < dlrsPowerTemp)
                    {
                        maxDlrsPowerTemp = dlrsPowerTemp;
                        ulrsPower = ulrsPowerTemp;
                        key = carrier;
                        index = i;
                    }
                    rsrpValue.Add(carrier, dlrsPowerTemp);
                }
                else if ((dlrsPowerTemp >= SimulationConstant.DLRSRP_ACCESS_THRESHOLD) && (maxDlrsPowerTemp < dlrsPowerTemp))
                {
                    maxDlrsPowerTemp = dlrsPowerTemp;
                }
            }
            //这个地方,maxValue有可能和上面的key小区不是对应的
            //用户的下行参考信号最大接收功率
            user.DlRsrp = maxDlrsPowerTemp;
            //用户的上行参考信号最大接收功率
            user.UlRsLevel = ulrsPower;
            if (key != null)
            {
                
                rsrpValue.Remove(key);
                CarrierTotalLoss loss2 = user.CarrierListInComputeArea[index];
                CarrierTotalLoss loss3 = user.CarrierListInComputeArea[0];
                //邻小区列表中的第一个是最佳服务小区
                user.CarrierListInComputeArea[0] = loss2;
                //得到用户的最佳服务小区
                user.BestServiceCellBeforeHandOver = loss2;

                user.CarrierListInComputeArea[index] = loss3;
                user.LTEUser.Tag = key.Carrier.Name;
               //dB值
                user.UlRsSinr = (user.UlRsLevel - key.AlgParameter.UlIoTTarget) - SimulationTools.ConvertLineTodB(key.UlRBNoisePower / 12f);
            }
        }
Example #8
0
 private void CanAssignRes(SimulationUser user, ref int residualRb, ref int relayNeedRbNum, float relaySinr, float relayMcsBySinr)
 {
     //此处relay.UlRbNum为eNB给relay分配的Rb数
     //relay需要的Rb不能超过eNB给他分配的Rb数
     if (relayNeedRbNum > user.UlRbNum)
     {
         relayNeedRbNum = user.UlRbNum;
     }
 }
Example #9
0
 private string GetUlUserMcsModulation(SimulationUser user, float sinr)
 {
     if (user.FailReason == FailReason.Satisfied)
     {
         int num;
         SimulationEffMcs.Instance.GetUlMcsEffbySinr(user, sinr, out num);
         return SimulationEffMcs.Instance.GetMcsModulation(num, LinkType.Uplink);
     }
     return string.Empty;
 }
Example #10
0
 private float CalculateUserServiceTime(SimulationUser user, int servicePeriod)
 {
     UnionPsService service = user.LTEUser.Service as UnionPsService;
     LTEService service2 = service.PSServiceDic[NetWorkType.LTE] as LTEService;
     if (service2.Type == ServiceType.Voice)
     {
         return (float) (user.ServiceCount * servicePeriod);
     }
     return user.ServiceCount;
 }
Example #11
0
 private void TryAssignRes(SimulationUser user, ref int residualRb)
 {
     float relaySinr = user.PuschSinr;
     float relayMcsBySinr = UlScheduleTools.GetMcsBySinr(user, relaySinr);
     int relayNeedRbNum = UlScheduleTools.GetRelayNodeNeedRbNum(user, relayMcsBySinr); //调度缓冲区数据需要的RB数
     //如果分配给relay的Rb大于缓冲区需要Rb,则数据能全部传完,Rb可能有剩
     //如果分配给relay的Rb小于缓冲区需要Rb,则数据有剩余,所分配Rb用完
     CanAssignRes(user, ref residualRb, ref relayNeedRbNum, relaySinr, relayMcsBySinr);
     TryGetRes(user, ref residualRb, relayNeedRbNum, relaySinr, relayMcsBySinr);
 }
Example #12
0
 private void CalNbrFreInterference(SimulationCarrier curCarrier, SimulationUser user, CarrierTotalLoss InCarrierTL, float[] rbIn, ref float rxPower)
 {
     float ulTotalLoss = InCarrierTL.UlTotalLoss;
     float num2 = SimulationTools.CalculateFactor(InCarrierTL.Carrier, curCarrier);
     rxPower = (num2 * SimulationTools.ConvertdBToLine(user.UeTxPower)) / ulTotalLoss;
     float num3 = rxPower / ((float) curCarrier.BandWidthRbNum);
     for (int i = 0; i < curCarrier.BandWidthRbNum; i++)
     {
         rbIn[i] += num3/2f;
     }
 }
Example #13
0
 private void CalaculateRbInOneUser(SimulationCarrier curCarrier, SimulationUser user, Dictionary<int, float[]> inDic, Dictionary<ISimulationCarrier, Dictionary<ISimulationCarrier, float>> carrierInDic, bool isICICPeriod)
 {
     for (int i = 0; i < user.CarrierListInComputeArea.Length; i++)
     {
         CarrierTotalLoss inCarrierTL = user.CarrierListInComputeArea[i];
         if (inCarrierTL.Carrier != user.BestServiceCarrier)
         {//计算用户受到的非主服务小区的干扰情况
             this.CalaculateRbInOneCarrier(curCarrier, user, inCarrierTL, inDic, carrierInDic, isICICPeriod);
         }
     }
 }
Example #14
0
 private MIMO GetMimo(OtherSubSysInterface subSysInterface, SimulationUser user, bool isSmSupport)
 {
     LTETerminal terminal = user.LTEUser.Terminal.NetTerminalList[0] as LTETerminal;
     if (user.LTEUser.LinkType == LinkType.Uplink)
     {
         int rxNum = SimulationTools.GetRxNum(user.BestServiceCarrier);
         return this.GetMimo(subSysInterface, terminal.TxAntNumber, rxNum, isSmSupport);
     }
     int txNum = SimulationTools.GetTxNum(user.BestServiceCarrier);
     return this.GetMimo(subSysInterface, txNum, terminal.RxAntNumber, isSmSupport);
 }
Example #15
0
 private void CalMacTBS(SimulationUser user)
 {
     if (SimulationConstant.IS_HARQ_ON)
     {
         user.MacTBS = ((((0x90 * user.RbList.Count) * user.UlMcsEff) - SimulationConstant.CRC_NUM) * user.MIMOClutterGain) / 1000f;
     }
     else
     {
         user.MacTBS = ((((((1f - user.ULBLER) * 144f) * user.RbList.Count) * user.UlMcsEff) - SimulationConstant.CRC_NUM) * user.MIMOClutterGain) / 1000f;
     }
 }
Example #16
0
 private void CaculateService(Dictionary<string, List<SimulationUser>> serviceUserListDic, SimulationUser user)
 {
     List<SimulationUser> list;
     if (!serviceUserListDic.TryGetValue(user.LTEUser.Service.Name, out list))
     {
         list = new List<SimulationUser>();
         list.Add(user);
         serviceUserListDic.Add(user.LTEUser.Service.Name, list);
     }
     else
     {
         list.Add(user);
     }
 }
Example #17
0
 private List<ISimulationUser> InitSimulationUser(List<User> users)
 {
     List<ISimulationUser> list = new List<ISimulationUser>();
     foreach (User user in users)
     {
         SimulationUser simU = new SimulationUser();
         simU.LTEUser = user;
         SetSimulationUserBLER(user, simU);
         this.SetSimulationVoiceUserPacket(user, simU);
         simU.ID = user.Id;
         list.Add(simU);
     }
     return list;
 }
Example #18
0
 /// <summary>
 /// 判断该小区是否在该用户的计算区域内
 /// </summary>
 /// <param name="simulationUser"></param>
 /// <param name="carrierID"></param>
 /// <param name="carrierIndex"></param>
 /// <returns></returns>
 public bool IsCarrierInUserNgbList(SimulationUser simulationUser, short carrierID, out int carrierIndex)
 {
     bool flag = false;
     carrierIndex = 0;
     for (int i = 0; i < simulationUser.CarrierListInComputeArea.Length; i++)
     {
         if (carrierID.Equals(simulationUser.CarrierListInComputeArea[i].Carrier.Carrier.ID))
         {
             flag = true;
             carrierIndex = i;
             return flag;
         }
     }
     return flag;
 }
Example #19
0
 private void CalIntraFreqInterference(SimulationUser user, CarrierTotalLoss InCarrierTL, float[] rbIn, ref float rxPower)
 {
     float ulTotalLoss = InCarrierTL.UlTotalLoss;
     rxPower = SimulationTools.ConvertdBToLine(user.UeTxPower) / ulTotalLoss;
     //每个Rb上的接收功率
     float num2 = rxPower / ((float) user.RbList.Count);
     //在user所对应的Rb上加上该干扰值
     foreach (byte num3 in user.RbList)
     {
         if ((num3) > 4)
             rbIn[0] += num2;
         else
             rbIn[num3] += num2;
     }
 }
Example #20
0
 public float GetMIMOClutterGain(OtherSubSysInterface subSysInterface, SimulationUser user, bool isSmSupport)
 {
     if ((user.BestServiceCarrier != null) && (subSysInterface != null))
     {
         float num;
         MIMO key = this.GetMimo(subSysInterface, user, isSmSupport);
         if (!this.m_MimoClutterGainDic.TryGetValue(key, out num))
         {
             float spatialMultiplex = subSysInterface.IClutterParams.GetClutterParamByCode(user.LTEUser.Clutter.Id).SpatialMultiplex;
             double num3 = SimulationTools.ConvertdBToLine(key.SmGain);
             num = Convert.ToSingle((double) (1.0 + ((num3 - 1.0) * spatialMultiplex)));
             this.m_MimoClutterGainDic.Add(key, num);
         }
         return num;
     }
     return 1f;
 }
Example #21
0
 private void CalUserMcs(SimulationUser user)
 {
     if (!user.IsUlFreqSel && !user.IsVMIMOUser)
     {
         int num2;
         float sinr = user.UserSinr + user.RandomSinr;
         float num3 = SimulationEffMcs.Instance.GetUlMcsEffbySinr(user, sinr, out num2);
         if ((num3 <= 0f) && (user.ServiceCount != 0))
         {
             user.ServiceCount = (short) (user.ServiceCount - 1);
             user.UlMcsEff = num3;
         }
         else if (num3 > 0f)
         {
             user.UlMcsEff = num3;
         }
     }
 }
Example #22
0
 private void CalacuateFBandData(SimulationUser simulationUser, Dictionary<Terminal, Dictionary<FrequencyBand, UserFBandData>> terminalFBPowerDic)
 {
     UserFBandData data = null;
     Dictionary<FrequencyBand, UserFBandData> dictionary = null;
     if (!terminalFBPowerDic.TryGetValue(simulationUser.LTEUser.Terminal, out dictionary))
     {
         dictionary = new Dictionary<FrequencyBand, UserFBandData>();
         terminalFBPowerDic.Add(simulationUser.LTEUser.Terminal, dictionary);
     }
     if (!dictionary.TryGetValue(simulationUser.BestServiceCarrier.Carrier.FreqBand, out data))
     {
         data = new UserFBandData();
         dictionary.Add(simulationUser.BestServiceCarrier.Carrier.FreqBand, data);
         /*下行每个RB上的噪声功率*/
         data.DlRBNoisePower = this.noisePowerObj.CalculateDlNoisePower(simulationUser.BestServiceCarrier.Carrier.FreqBand, simulationUser.LTEUser.Terminal, 12);
         data.DlRENoisePower = data.DlRBNoisePower / 12f;
     }
     simulationUser.FBandData = data;
 }
        public void MyTestInitialize()
        {
            m_SatisificationCalculate = new SatisficationCalculate(m_currentTTI, m_sfCalTh);
            m_sfCalTh = new SatisficationThParam();
            m_VoiceUserList = new List<ISimulationUser>();
            m_UserList = new List<ISimulationUser>();
            m_VoiceUser = new SimulationUser();
            m_GBRUserList = new List<ISimulationUser>();
            m_DataUserList = new List<ISimulationUser>();
            m_NonGBRUserList = new List<ISimulationUser>();
            m_User = new SimulationUser();
            Service serv = new UnionPsService();
            m_User.LTEUser = new User();

            SimulationUser user1 = new SimulationUser();
            SimulationUser user2 = new SimulationUser();

            m_GBRUserList.Add(user1);
            m_GBRUserList.Add(user2);
            m_UserList.Add(m_User);
            m_DataUserList.Add(m_User);
            m_VoiceUserList.Add(m_User);

            m_User.AdmissionUserTag = new AdmissionControlUserTag();
            AdmissionControlUserTag tag2 = m_User.AdmissionUserTag as AdmissionControlUserTag;

            m_User.LTEUser.Service = serv;
            m_User.LTEUser.Service = new Huawei.UNet.Traffic.Interface.UnionPsService();
            NetworkTerminal networkTerminal = new NetworkTerminal();
            ((Huawei.UNet.Traffic.Interface.UnionPsService)(m_User.LTEUser.Service)).PSServiceDic = new Dictionary<Huawei.UNet.Frame.Interface.NetWorkType, Huawei.UNet.Traffic.Interface.Service>();
            ((Huawei.UNet.Traffic.Interface.UnionPsService)(m_User.LTEUser.Service)).PSServiceDic.Add(NetWorkType.LTE, new Huawei.UNet.Traffic.LTEModel.LTEService());


            m_UlMinThroughputDemand = new UnionPsService();
            m_UlTxEff = new UnionPsService();
            m_UlOffset = new UnionPsService();

            
            
            
        }
Example #24
0
 /// <summary>
 /// 计算下行参考信号初始SINR
 /// </summary>
 /// <param name="simulationUser"></param>
 private void CalacuteDlRsSinrOfOneUser(SimulationUser simulationUser)
 {
     float dlTargetLoad = 0f;
     float bestServerDlTargetLoad = 0f;
     float bestServerRsRePower = 0f;
     float bestServerMaxPower = 0f;
     float dlTotalLoss = 0f;
     float dlRsSinr = 0f;
     float dlInterferenceBwSum = 0f;
     float dlInterferenceReSum = 0f;
     float dlInterferenceBw = 0f;
     float dlInterferenceRe = 0f;
     float dlRBNoisePowerSum = 0f;
     foreach (CarrierTotalLoss loss in simulationUser.CarrierListInComputeArea)
     {
         SimulationCarrier simulationCarrier = loss.Carrier;
         dlTargetLoad = simulationCarrier.Carrier.DlTargetLoad;
         if (simulationCarrier.Carrier != simulationUser.BestServiceCarrier.Carrier)
         {
             this.interferenceObj.CalculateDlInterference(simulationCarrier, simulationUser, loss.DlTotalLoss, ref dlInterferenceBw, ref dlInterferenceRe);
             dlInterferenceBwSum += dlInterferenceBw;
             dlInterferenceReSum += dlInterferenceRe;
         }
         else
         {
             bestServerDlTargetLoad = simulationCarrier.Carrier.DlTargetLoad;
             dlTotalLoss = loss.DlTotalLoss;
             bestServerRsRePower = simulationCarrier.RsRePower / dlTotalLoss;
             bestServerMaxPower = SimulationTools.ConvertdBToLine(simulationCarrier.Carrier.MaxPower) / dlTotalLoss;
         }
     }
     //全带宽上的RB噪声
     dlRBNoisePowerSum = simulationUser.DlRBNoisePower * simulationUser.BestServiceCarrier.BandWidthRbNum;
     dlRsSinr = SimulationTools.ConvertLineTodB(bestServerRsRePower / ((dlInterferenceReSum * bestServerDlTargetLoad) + simulationUser.DlRENoisePower));
     simulationUser.DlInitRsSinr = dlRsSinr;
     simulationUser.DlRsSinr = dlRsSinr;
     //用户全带宽上的平均SINR=bestserver全带宽上最大发射功率/(全带宽上的RB噪声+全带宽上的干扰)
     simulationUser.Geometry = SimulationTools.ConvertLineTodB(bestServerMaxPower / (dlInterferenceBwSum + dlRBNoisePowerSum));
 }
Example #25
0
        public void MyTestInitialize()
        {
            m_VoicewaitUserList = new List<ISimulationUser>();
            SimulationUser ue1 = new SimulationUser();
            m_VoicewaitUserList.Add(ue1);
            m_OfflineUserList = new List<ISimulationUser>();
            m_OfflineUserList.Add(ue1);
            m_OffLineVUService = new OfflineService(m_CurrentTTI, m_OfflineThresholdParam );
            m_DataWaitUserList = new List<ISimulationUser>();
            m_GBRUserList = new List<ISimulationUser>();
            m_OfflineUserList = new List<ISimulationUser>();
            m_DataWaitUserList.Add(ue1);
            m_GBRUserList.Add(ue1);
            m_OfflineUserList.Add(ue1);
            m_OffLineDUService = new OfflineService(m_CurrentTTI, m_OfflineThresholdParam);
            m_DataUser = new SimulationUser();
            SimulationUser DU1 = new SimulationUser();
            m_OfflineThresholdParam = new OfflineThresholdParam();
            m_OfflineDU = new OfflineService(m_CurrentTTI, m_OfflineThresholdParam);
            m_CurrentTTI = 1000;

        }
Example #26
0
        //private Logger logger = new Logger(typeof(DlInterferenceModuling));
        //private NoisePowerCalculation noisePowerObj = new NoisePowerCalculation();

        //private void CalculateDlFirstNbrFreqIN(SimulationCarrier curCarrier, SimulationCarrier inCarrier, float dlTotalLoss, List<byte> rbList, List<float> userIN)
        //{
        //    float num;
        //    num = this.CalculatorUserCount(inCarrier) ? (num = inCarrier.RsRbPower * inCarrier.BandWidthRbNum) : inCarrier.TxPower;
        //    float num3 = (SimulationTools.CalculateFactor(inCarrier, curCarrier) * num) / dlTotalLoss;
        //    float num4 = num3 / ((float) inCarrier.BandWidthRbNum);
        //    for (int i = 0; i < rbList.Count; i++)
        //    {
        //        List<float> list;
        //        int num6;
        //        (list = userIN)[num6 = i] = list[num6] + num4;
        //    }
        //}

        //public List<float> CalculateDlFsIN(SimulationUser user, List<byte> rbList)
        //{
        //    List<float> userIN = new List<float>();
        //    float dlRBNoisePower = user.DlRBNoisePower;
        //    foreach (byte num2 in rbList)
        //    {
        //        userIN.Add(dlRBNoisePower);
        //    }
        //    SimulationCarrier bestServiceCarrier = user.BestServiceCarrier;
        //    for (int i = 1; i < user.CarrierListInComputeArea.Length; i++)
        //    {
        //        CarrierTotalLoss loss = user.CarrierListInComputeArea[i];
        //        SimulationCarrier carrier = loss.Carrier;
        //        float dlTotalLoss = loss.DlTotalLoss;
        //        this.CalculateDlINOneCarrier(bestServiceCarrier, carrier, dlTotalLoss, rbList, userIN);
        //    }
        //    return userIN;
        //}

        //private void CalculateDlINOneCarrier(SimulationCarrier curCarrier, SimulationCarrier inCarrier, float dlTotalLoss, List<byte> rbList, List<float> userIN)
        //{
        //    if (SimulationTools.isTheSameFreCell(inCarrier, curCarrier))
        //    {
        //        this.CalculateDlSameFreqIN(inCarrier, dlTotalLoss, rbList, userIN);
        //    }
        //    else if (SimulationTools.isTheFirstNbrFreCell(inCarrier, curCarrier))
        //    {
        //        this.CalculateDlFirstNbrFreqIN(curCarrier, inCarrier, dlTotalLoss, rbList, userIN);
        //    }
        //}

        //public float CalculateDlInterference(SimulationUser user)
        //{
        //    float totalLoss = 0f;
        //    float num2 = 0f;
        //    float num3 = 0f;
        //    float num4 = 0f;
        //    CarrierTotalLoss[] carrierListInComputeArea = user.CarrierListInComputeArea;
        //    for (int i = 1; i < carrierListInComputeArea.Length; i++)
        //    {
        //        CarrierTotalLoss loss = carrierListInComputeArea[i];
        //        SimulationCarrier otherCarrier = loss.Carrier;
        //        otherCarrier.TxPower = (otherCarrier.DlUserList.Count == 0) ? (otherCarrier.RsRbPower * otherCarrier.BandWidthRbNum) : otherCarrier.TxPower;
        //        totalLoss = loss.DlTotalLoss;
        //        if (SimulationTools.isTheSameFreCell(otherCarrier, user.BestServiceCarrier))
        //        {
        //            num2 += this.CalculateRxPower(otherCarrier.TxPower, totalLoss);
        //        }
        //        else if (SimulationTools.isTheFirstNbrFreCell(otherCarrier, user.BestServiceCarrier))
        //        {
        //            num4 = SimulationTools.CalculateFactor(otherCarrier, user.BestServiceCarrier);
        //            num2 += (otherCarrier.TxPower * num4) / totalLoss;
        //        }
        //    }
        //    num3 = user.CarrierListInComputeArea[0].Carrier.BandWidthRbNum * user.DlRBNoisePower;
        //    return (num2 + num3);
        //}

        public void CalculateDlInterference(SimulationCarrier simulationCarrier, SimulationUser simulationUser, float dlTotalLoss, ref float dlInterferenceBw, ref float dlInterferenceRe)
        {
            float num = 0f;
            float num2 = 0f;
            int num3 = 0;
            num3 = simulationUser.BestServiceCarrier.BandWidthRbNum * 12;
            num = SimulationTools.ConvertdBToLine(simulationCarrier.Carrier.MaxPower);
            if (SimulationTools.isTheSameFreCell(simulationCarrier, simulationUser.BestServiceCarrier))
            {
                /*干扰小区对目标小区在下行整个带宽上的干扰功率为干扰小区的最大发射功率发射减去
                 * 该干扰小区到被干扰用户的下行链路损耗*/
                dlInterferenceBw = num / dlTotalLoss;
                /*干扰小区对目标小区RE带宽级上的干扰功率为干扰小区对目标小区整个带宽上的干扰功
                 * 率乘以干扰小区的目标负载,再除以目标小区里的RE数目*/
                dlInterferenceRe = (dlInterferenceBw * simulationCarrier.Carrier.DlTargetLoad) / ((float) num3);
            }
            else if (SimulationTools.isTheFirstNbrFreCell(simulationCarrier, simulationUser.BestServiceCarrier))
            {
                num2 = SimulationTools.CalculateFactor(simulationCarrier, simulationUser.BestServiceCarrier);
                dlInterferenceBw = (num * num2) / dlTotalLoss;
                dlInterferenceRe = (dlInterferenceBw * simulationCarrier.Carrier.DlTargetLoad) / ((float) num3);
            }
        }
Example #27
0
 private void CalUserMcs(SimulationUser user)
 {
     if (!user.IsUlFreqSel )//&& !user.IsVMIMOUser)
     {
         int num2;
         //float sinr;
         //修改sinr应为user的PDSCHSINR(下行)或PUSCHSINR(上行)
         //if (user.BestServiceCarrier.LinkType ==LinkType.Uplink)
         //{ sinr = user.PuschSinr; }
         //else
         //{ sinr = user.PdschSinr; }
         float sinr = user.UserSinr + user.RandomSinr;
         float num3 = SimulationEffMcs.Instance.GetUlMcsEffbySinr(user, sinr, out num2);
         if ((num3 <= 0f) && (user.ServiceCount != 0))
         {
             user.ServiceCount = (short)(user.ServiceCount - 1);
             user.UlMcsEff = num3;
         }
         else if (num3 > 0f)
         {
             user.UlMcsEff = num3;
         }
     }
 }
Example #28
0
 private void CalaculateRbInOneCarrier(SimulationCarrier curCarrier, SimulationUser user, CarrierTotalLoss InCarrierTL, Dictionary<int, float[]> inDic, Dictionary<ISimulationCarrier, Dictionary<ISimulationCarrier, float>> carrierInDic, bool isICICPeriod)
 {
     
     float[] numArray;
     if (!inDic.TryGetValue(InCarrierTL.Carrier.ID, out numArray))
     {
         numArray = new float[InCarrierTL.Carrier.BandWidthRbNum];
         inDic.Add(InCarrierTL.Carrier.ID, numArray);
     }
     float rxPower = -1f;
     if (SimulationTools.isTheSameFreCell(InCarrierTL.Carrier, curCarrier))
     {
         this.CalIntraFreqInterference(user, InCarrierTL, numArray, ref rxPower);
     }
     else if (SimulationTools.isTheFirstNbrFreCell(InCarrierTL.Carrier, curCarrier))
     {
         this.CalNbrFreInterference(curCarrier, user, InCarrierTL, numArray, ref rxPower);
     }
     if (isICICPeriod && (rxPower > 0f))
     {
         float num2;
         Dictionary<ISimulationCarrier, float> dictionary;
         if (!carrierInDic.TryGetValue(InCarrierTL.Carrier, out dictionary))
         {
             dictionary = new Dictionary<ISimulationCarrier, float>();
             carrierInDic.Add(InCarrierTL.Carrier, dictionary);
         }
         if (!dictionary.TryGetValue(curCarrier, out num2))
         {
             num2 = 0f;
             dictionary.Add(curCarrier, num2);
         }
         num2 += rxPower;
         dictionary[curCarrier] = num2;
     }
 }
Example #29
0
 /// <summary>
 /// 邻小区列表中前3位是最佳服务小区,第一强邻小区,第二强邻小区
 /// </summary>
 /// <param name="user"></param>
 /// <param name="sfSbSecondStroNbr"></param>
 private void UpdateSfSbStroNbrTotalLossIndex(SimulationUser user, ISimulationCarrier sfSbStroNbr)
 {
     for (int i = 0; i < user.CarrierListInComputeArea.Length; i++)
     {
         if (user.CarrierListInComputeArea[i].Carrier.Equals(sfSbStroNbr))
         {
             CarrierTotalLoss loss = user.CarrierListInComputeArea[i];
             CarrierTotalLoss loss2 = user.CarrierListInComputeArea[1];
             user.CarrierListInComputeArea[i] = loss2;
             user.CarrierListInComputeArea[1] = loss;
             user.StroNbrBeforeHandOver = loss;
             break;
         }
     }
 }
Example #30
0
        /// <summary>
        /// 找到用户接收功率最强的邻小区(同时用户到这些邻小区的接收功率符合接入门限)
        /// </summary>
        /// <param name="user"></param>
        /// <param name="rsrpValue"></param>
        private void findStroRsrp(SimulationUser user, Dictionary<SimulationCarrier, float> rsrpValue)
        {
            float minValue = float.MinValue;
            user.SfSbStroRsrp = float.MinValue;
            ISimulationCarrier sfSbStroNbr = null;
            float uLFrequency = 0f;
            float dLFrequency = 0f;
            foreach (KeyValuePair<SimulationCarrier, float> pair in rsrpValue)
            {
                LteAlgParam.EdgeUserFreStyle ulEdgeUserFreNum;
                LteAlgParam.EdgeUserFreStyle dlEdgeUserFreNum;
                if (user.LTEUser.LinkType == LinkType.Uplink)
                {
                    uLFrequency = pair.Key.Carrier.FreqBand.ULFrequency;
                    dLFrequency = user.BestServiceCarrier.Carrier.FreqBand.ULFrequency;
                    ulEdgeUserFreNum = pair.Key.AlgParameter.UlEdgeUserFreNum;
                    dlEdgeUserFreNum = user.BestServiceCarrier.AlgParameter.UlEdgeUserFreNum;
                }
                else
                {
                    uLFrequency = pair.Key.Carrier.FreqBand.DLFrequency;
                    dLFrequency = user.BestServiceCarrier.Carrier.FreqBand.DLFrequency;
                    ulEdgeUserFreNum = pair.Key.AlgParameter.DlEdgeUserFreNum;
                    dlEdgeUserFreNum = user.BestServiceCarrier.AlgParameter.DlEdgeUserFreNum;
                }
                if (((user.SfSbStroRsrp < pair.Value) && (pair.Key.BandWidthRbNum == user.BestServiceCarrier.BandWidthRbNum))
                    && (uLFrequency == dLFrequency))
                {
                    user.SfSbStroRsrp = pair.Value;
                    sfSbStroNbr = pair.Key;
                }


                bool a = (minValue < pair.Value) && (pair.Key.BandWidthRbNum == user.BestServiceCarrier.BandWidthRbNum);
                bool b = (uLFrequency == dLFrequency);
                if (pair.Key.IsLTECell == true && user.BestServiceCarrier.IsLTECell == true) 
                {
                    b = b && (pair.Key.Carrier.Parent.Parent.ID == user.BestServiceCarrier.Carrier.Parent.Parent.ID);
                }
                bool c = ulEdgeUserFreNum == dlEdgeUserFreNum;
                if (a && b && c)
                {
                    minValue = pair.Value;
                    //同站址最强邻小区
                    user.SfSbSsSsStroNbr = pair.Key;
                }
            }
            if (sfSbStroNbr != null)
            {
                this.UpdateSfSbStroNbrTotalLossIndex(user, sfSbStroNbr);
                SimulationCarrier key = sfSbStroNbr as SimulationCarrier;
                rsrpValue.Remove(key);
            }
        }