public float GetDlMcsEffbySinr(ISimulationUser user, float sinr, out int mcsIndex) { float amsThreshold;//自适应MIMO切换门限 if (this._mcsInstance == null) { mcsIndex = -1; SimulationUser user2 = user as SimulationUser; amsThreshold = user2.BestServiceCarrier.AmsThreshold; //是否能够支持多码字的布尔值 bool isMCW = (sinr > amsThreshold) && user2.IsAmsSupported; return SimulationTools.GetDlEffbySinr(sinr, isMCW); } SimulationUser user3 = user as SimulationUser; bool isSmSupported = user3.IsSmSupported;//是否支持空分复用 amsThreshold = user3.BestServiceCarrier.AmsThreshold; if (user3.IsAmsSupported && (sinr < amsThreshold)) { isSmSupported = false; } if (SimulationConstant.IS_HARQ_ON) { sinr += SimulationConstant.HARQ_GAIN; } SimulationUser user4 = user as SimulationUser; int txNum = SimulationTools.GetTxNum(user4.BestServiceCarrier); Terminal terminal = user.LTEUser.Terminal; LTETerminal terminal2 = terminal.NetTerminalList[0] as LTETerminal; Mobility mobility = user.LTEUser.Mobility; MIMO mimo = this._mcsInstance.GetMIMO(txNum, terminal2.RxAntNumber, isSmSupported); McsParas paras = this._mcsInstance.GetMCSBySINR(terminal.Reception, mobility, mimo, user4.DLBLER, sinr, user.LTEUser.Terminal.DownLinkBearer); mcsIndex = paras.McsIndex; return paras.BearEff; }
public List<Demodulation> GetDlSinrListByUe(ISimulationUser user) { if (this._mcsInstance != null) { SimulationUser user2 = user as SimulationUser; int txNum = SimulationTools.GetTxNum(user2.BestServiceCarrier); Terminal terminal = user.LTEUser.Terminal; LTETerminal terminal2 = terminal.NetTerminalList[0] as LTETerminal; LTEService service2 = SimulationTools.GetUnionPsService(user.LTEUser.Service).PSServiceDic[NetWorkType.LTE] as LTEService; Mobility mobility = user.LTEUser.Mobility; MIMO mimo = this._mcsInstance.GetMIMO(txNum, terminal2.RxAntNumber, user2.IsSmSupported); return this._mcsInstance.GetDemodulation(terminal.Reception, mobility, mimo, service2.DLBLER); } GlobalParameter parameter = GlobalParameter.getInstance(); List<Demodulation> list = new List<Demodulation>(); float[] dlTargetSinrSFBC = parameter.m_DlTargetSinrSFBC; for (int i = 0; i < dlTargetSinrSFBC.Length; i++) { Demodulation item = new Demodulation(); item.Sinr = dlTargetSinrSFBC[i]; item.McsIndex = i + 1; list.Add(item); } return list; }
private void DlPowerControlOpenUserOperate(IDlPowerControlCarrier carrier, DlPowerControlCarrierTag carrierTag, ISimulationUser iSimulationUser, DlPowerControlUserTag userTag) { float dlSinrTarget = 2.147484E+09f; List<Demodulation> dlTargetSinrList = null; Dictionary<int, int> dictionary = null; IDlPowerControlUser user = PowerControlTools.ConvertIDlPcUser(iSimulationUser); dlTargetSinrList = this.m_MCSQuery.GetDlSinrListByUe(iSimulationUser); this.m_AvgBR_MCS_RbNum.TryGetValue(user.LTEUser.Service.Name, out dictionary); if (userTag.IsFullBuffer) { dlSinrTarget = PowerControlTools.QueryDlFullbufferUserSinrTarget(carrier, user, dlTargetSinrList, carrierTag.PdschRBNum); } else { dlSinrTarget = PowerControlTools.QueryDlNormalUserSinrTarget(carrier, user, carrierTag.PdschRBNum, dictionary, dlTargetSinrList); } //根据目标sinr和测量得到的sinr计算功控步长 user.PowerOffset = PowerControlTools.GetPowerOffset(dlSinrTarget, userTag.FilterMeasRSSinr); if ((carrier.IsDlIcicOn && !user.IsEdgeUser) && (user.PowerOffset > SimulationConstant.POWEROFFSET_TH)) { user.PowerOffset = SimulationConstant.POWEROFFSET_TH; } user.PowerOffsetTypeA = user.PowerOffset; user.PowerOffsetTypeB = user.PowerOffsetTypeA + (10f * ((float) Math.Log10((double) this.m_TabelPowerOffsetPorportion[carrier.PB]))); userTag.DlSinrTarget = dlSinrTarget; if (((iSimulationUser as SimulationUser).BestServiceCarrier.ID == 0) && ((iSimulationUser as SimulationUser).UserDlTotalThroughput < 30000f)) { this.printString = string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}", new object[] { this.m_TTI, user.ID, userTag.IsFullBuffer, !user.IsEdgeUser, user.PowerOffsetTypeA, userTag.FilterMeasRSSinr, userTag.DlSinrTarget, (iSimulationUser as SimulationUser).UsedRbNum }); this.printContent.AppendLine(this.printString); this.fileName = string.Format("FDD2.0算法功控内部参数.txt", new object[0]); } }
private bool CarrierInComputerArea(ISimulationUser iuser, ISimulationCarrier targetCarrier) { float calcRadius = SimulationTools.GetCalcRadius(targetCarrier); double[] xy = SimulationTools.GetSitePosition(targetCarrier); List<AntConfig> antConfiguration = SimulationTools.GetAntConfig(targetCarrier.Carrier); double maxValue = double.MaxValue; foreach (AntConfig config in antConfiguration) { double num5 = iuser.LTEUser.X - (xy[0] + config.DX); double num6 = iuser.LTEUser.Y - (xy[1] + config.DY); maxValue = Math.Min(maxValue, (num5 * num5) + (num6 * num6)); } return (maxValue <= (calcRadius * calcRadius)); }
/// <summary> /// 优先级小的排在前面 /// </summary> /// <param name="UserX"></param> /// <param name="UserY"></param> /// <returns></returns> private int CompareBypriorty(ISimulationUser UserX, ISimulationUser UserY) { IAdmissionUser user = UserX as IAdmissionUser; IAdmissionUser user2 = UserY as IAdmissionUser; AdmissionControlUserTag admissionUserTag = user.AdmissionUserTag as AdmissionControlUserTag; AdmissionControlUserTag tag2 = user2.AdmissionUserTag as AdmissionControlUserTag; if (admissionUserTag.Priority < tag2.Priority) { return -1; } if (admissionUserTag.Priority > tag2.Priority) { return 1; } return 0; }
/// <summary> /// 把voip用户加入到相应的UlVoiceNewAccessUserList或DlVoiceNewAccessUserList中 /// </summary> /// <param name="carrier"></param> /// <param name="user"></param> /// <param name="ulNum">当前TTI下已接入的上行语音用户</param> /// <param name="dlNum">当前TTI下已接入的下行语音用户</param> /// <param name="ulNumTarget">当前TTI下最多能接入的上行语音用户</param> /// <param name="dlNumTarget">当前TTI下最多能接入的下行语音用户</param> /// <returns>是否能成功的把voice用户加入到DlVoiceNewAccessUserList或UlVoiceNewAccessUserList</returns> private bool AddVoipUserToList(SimulationCarrier carrier, ISimulationUser user, ref int ulNum, ref int dlNum, int ulNumTarget, int dlNumTarget) { bool flag = false; if ((user.LTEUser.LinkType == LinkType.Uplink) && (ulNum < ulNumTarget)) { carrier.UlVoiceNewAccessUserList.Add(user); ulNum++; return true; } if ((user.LTEUser.LinkType == LinkType.Downlink) && (dlNum < dlNumTarget)) { carrier.DlVoiceNewAccessUserList.Add(user); dlNum++; flag = true; } return flag; }
/// <summary> /// 判断该用户对该小区的参考信号的接收功率是否满意 /// </summary> /// <param name="user"></param> /// <param name="carrier"></param> /// <param name="carrierIndex"></param> /// <returns></returns> public bool IsRSRPSatisfy(ISimulationUser user, IAdmissionCarrier carrier, out int carrierIndex) { carrierIndex = 0; SimulationUser simulationUser = user as SimulationUser; if (this.IsCarrierInUserNgbList(simulationUser, carrier.Carrier.ID, out carrierIndex)) { float dlRSRP = carrier.RSPower - SimulationTools.ConvertLineTodB(simulationUser.CarrierListInComputeArea[carrierIndex].DlTotalLoss); float uLRSRP = ((simulationUser.LTEUser.Terminal.NetTerminalList[0] as LTETerminal).MaxTxPower - SimulationTools.ConvertLineTodB(12f)) - SimulationTools.ConvertLineTodB(simulationUser.CarrierListInComputeArea[carrierIndex].UlTotalLoss); bool isDlRSRPOK = dlRSRP >= SimulationConstant.DLRSRP_ACCESS_THRESHOLD; bool isUlRSRPOK = uLRSRP >= SimulationConstant.ULRSRP_ACCESS_THRESHOLD; return (isDlRSRPOK && isUlRSRPOK); } return false; }
public abstract int CompareUserBySINR(ISimulationUser userX, ISimulationUser userY);
private void InitUserState(ISimulationUser user, SimulationDataManager dataManager) { if (user.LTEUser.LinkType == LinkType.Uplink) { dataManager.UlUserNum++; } else { dataManager.DlUserNum++; } user.State = State.NoCover; }
private LTEService GetService(ISimulationUser user) { UnionPsService service = user.LTEUser.Service as UnionPsService; return (service.PSServiceDic[NetWorkType.LTE] as LTEService); }
public static float GetMcsBySinr(ISimulationUser user, float sinr) { int num; return SimulationEffMcs.Instance.GetUlMcsEffbySinr(user, sinr, out num); }
public void GetDlUserSinrTargetBound(ISimulationUser user, ISimulationCarrier carrier, out float minSinr, out float maxSinr, bool isSmSupport) { if (this._mcsInstance == null) { GlobalParameter parameter = GlobalParameter.getInstance(); minSinr = parameter.m_DlTargetSinrSFBC[0]; maxSinr = parameter.m_DlTargetSinrSFBC[parameter.m_DlTargetSinrSFBC.Length - 1]; } else { Terminal terminal = user.LTEUser.Terminal; LTETerminal terminal2 = terminal.NetTerminalList[0] as LTETerminal; int txNum = SimulationTools.GetTxNum(carrier as SimulationCarrier); this._mcsInstance.GetMinOrMaxSINR(terminal.Reception, user.LTEUser.Mobility, txNum, terminal2.RxAntNumber, isSmSupport, user.DLBLER, out minSinr, out maxSinr); } }
public void GetUlUserSinrTargetBound(ISimulationUser user, ISimulationCarrier carrier, out float minSinr, out float maxSinr) { if (this._mcsInstance == null) { GlobalParameter parameter = GlobalParameter.getInstance(); minSinr = parameter.m_UlTargetSinr[0]; maxSinr = parameter.m_UlTargetSinr[parameter.m_UlTargetSinr.Length - 1]; } else { LTETerminal terminal = user.LTEUser.Terminal.NetTerminalList[0] as LTETerminal; int rxNum = SimulationTools.GetRxNum(carrier as SimulationCarrier); this._mcsInstance.GetMinOrMaxSINR(carrier.Carrier.Reception, user.LTEUser.Mobility, terminal.TxAntNumber, rxNum, terminal.UlSmSupported, user.ULBLER, out minSinr, out maxSinr); } }
public float GetUlSinrEffbyMcs(ISimulationUser user, float mcs, out float sinr) { sinr = 0f; if (this._mcsInstance == null) { sinr = SimulationTools.GetUlSinrByMcsEff(mcs); return sinr; } SimulationUser user2 = user as SimulationUser; Terminal terminal = user.LTEUser.Terminal; Mobility mobility = user.LTEUser.Mobility; MIMO mIMOType = SimulationTools.GetMIMOType(this._mcsInstance, user as SimulationUser); sinr = this._mcsInstance.GetSinrByBearEffiency(user2.BestServiceCarrier.Carrier.Reception, mobility, mIMOType, user.ULBLER, terminal.UpLinkBearer, mcs); return sinr; }
/// <summary> /// 根据Sinr获得上行调制方式有效参数,从业务建模中读表对应 /// </summary> /// <param name="user"></param> /// <param name="sinr"></param> /// <param name="mcsIndex"></param> /// <returns></returns> public float GetUlMcsEffbySinr(ISimulationUser user, float sinr, out int mcsIndex) { double num; int rxNumber; float iOTTTI; if (this._mcsInstance == null) { mcsIndex = -1; num = 0.0; if (SimulationConstant.IS_IRC_ON) { rxNumber = SimulationTools.GetRxNum((user as SimulationUser).BestServiceCarrier); iOTTTI = (user as SimulationUser).BestServiceCarrier.IOTTTI; num = Huawei.UNet.Application.Common.IRC.IRC.CalculateIRCGain(rxNumber, (double) iOTTTI); } return SimulationTools.GetUlEffbySinr(sinr, (float) num); } if (SimulationConstant.IS_HARQ_ON) { sinr += SimulationConstant.HARQ_GAIN; } SimulationUser user2 = user as SimulationUser; LTETerminal terminal = user.LTEUser.Terminal.NetTerminalList[0] as LTETerminal; Mobility mobility = user.LTEUser.Mobility; MIMO mimo = this._mcsInstance.GetMIMO(terminal.TxAntNumber, SimulationTools.GetRxNum(user2.BestServiceCarrier), terminal.UlSmSupported); if (SimulationConstant.IS_IRC_ON) { rxNumber = SimulationTools.GetRxNum(user2.BestServiceCarrier); iOTTTI = user2.BestServiceCarrier.IOTTTI; num = Huawei.UNet.Application.Common.IRC.IRC.CalculateIRCGain(rxNumber, (double) iOTTTI); sinr += (float) num; } McsParas paras = this._mcsInstance.GetMCSBySINR(user2.BestServiceCarrier.Carrier.Reception, mobility, mimo, user2.ULBLER, sinr, user.LTEUser.Terminal.UpLinkBearer); mcsIndex = paras.McsIndex; return paras.BearEff; }
public static IUlScheduleUser ConvertToUlSchUser(ISimulationUser user) { return (user as IUlScheduleUser); }
private void ResetUserState(ISimulationUser user) { user.State = State.Wait; }
/// <summary> /// 更新原小区和目标小区的list,完成用户的切换 /// </summary> /// <param name="iSourceCarrier"></param> /// <param name="iTargetCarrier"></param> /// <param name="user"></param> public void UpdateList(IAdmissionCarrier iSourceCarrier, IAdmissionCarrier iTargetCarrier, ISimulationUser user) { if ((user.LTEUser.Service as UnionPsService).Type == ServiceType.Voice) { iTargetCarrier.UlUserList.Add(user); iTargetCarrier.ULHandOverVoiceUserList.Add(user); iSourceCarrier.UlUserList.Remove(user); iSourceCarrier.UlVoiceWaitUserList.Remove(user); } else { iTargetCarrier.UlUserList.Add(user); iTargetCarrier.ULHandOverDataUserList.Add(user); iSourceCarrier.UlUserList.Remove(user); iSourceCarrier.UlDataWaitUserList.Remove(user); } }
/// <summary> /// 根据用户的PuschSinr,把要用于负载均衡的用户进行排序(PuschSinr小的用户排在前面) /// </summary> /// <param name="simulationUserX"></param> /// <param name="simulationUserY"></param> /// <returns></returns> public override int CompareUserBySINR(ISimulationUser simulationUserX, ISimulationUser simulationUserY) { IAdmissionUser user = simulationUserX as IAdmissionUser; IAdmissionUser user2 = simulationUserY as IAdmissionUser; if (user.PuschSinr < user2.PuschSinr) { return -1; } if (user.PuschSinr > user2.PuschSinr) { return 1; } return 0; }
/// <summary> /// 得到用户所在的位置坐标 add by xujuan 2011.04.21 /// </summary> /// <param name="user"></param> /// <returns></returns> public static double[] GetUserPosition(ISimulationUser user) { double user_X; double user_Y; SimulationUser simuUser = user as SimulationUser; if (simuUser.IsRelayUser == false) { user_X = simuUser.LTEUser.X; user_Y = simuUser.LTEUser.Y; } else { user_X = simuUser.RelayUser.ParentRN.X; user_Y = simuUser.RelayUser.ParentRN.Y; } double[] userPosition = new double[2] { user_X, user_Y }; return userPosition; }
/// <summary> /// 把voice用户分派到UlVoiceNewAccessUserList或DlVoiceNewAccessUserList中 /// </summary> /// <param name="carrier"></param> /// <param name="user"></param> /// <param name="ulNum"></param> /// <param name="dlNum"></param> /// <param name="ulNumTarget"></param> /// <param name="dlNumTarget"></param> /// <param name="userIndex"></param> private void MoveVoipUserToList(SimulationCarrier carrier, ISimulationUser user, ref int ulNumCurrent, ref int dlNumCurrent, int ulNumTarget, int dlNumTarget, int userIndex) { if (this.AddVoipUserToList(carrier, user, ref ulNumCurrent, ref dlNumCurrent, ulNumTarget, dlNumTarget)) { carrier.VoiceNewUserList.RemoveAt(userIndex); } }