public void Init() { cellResultUpdater = new HSUPA_CellResultUpdater(); commonParam = new HSUPA_CommonParam(MockContext.CreatContext()); cell = MockCell.CreatUMTSSimCell(0, 0); user = MockUser.CreatUMTSPSUser(); user2 = MockUser.CreatUMTSPSUser(); user3 = MockUser.CreatUMTSPSUser(); user.HSUPA_ULTxPowerList.Add(10); user2.HSUPA_ULTxPowerList.Add(10); user3.HSUPA_ULTxPowerList.Add(10); user.HSUPA_ULThroughputList.Add(64000); user2.HSUPA_ULThroughputList.Add(32000); user3.HSUPA_ULThroughputList.Add(10000); user.HSUPA_ScheduleRateList.Add(64000); user2.HSUPA_ScheduleRateList.Add(64000); user3.HSUPA_ScheduleRateList.Add(64000); cell.ServerdHSUPAUser.Clear(); cell.ServerdHSUPAUser.Add(user); cell.ServerdHSUPAUser.Add(user2); cell.ServerdHSUPAUser.Add(user3); commonParam.CellList.Add(cell); commonParam.SimTTINumber = 1; cellResultUpdater.CommonParams = commonParam; }
public UMTSHSDPABearer FindBearByRate(UMTSSimCell cell, UMTSSimUser user) { List<UMTSHSDPABearer> bearList = new List<UMTSHSDPABearer>(); foreach (UMTSHSDPABearer bear in m_BearList) { if (bear.RlcPeakthroughput > user.RequestRate) { bearList.Add(bear); } } //存在某个速率对应多个承载的问题 float minRate = GetMinRateInBear(bearList); List<UMTSHSDPABearer> availbaleBearList = new List<UMTSHSDPABearer>(); foreach (UMTSHSDPABearer bear in bearList) { if (bear.RlcPeakthroughput == minRate) { availbaleBearList.Add(bear); } } SortBear(availbaleBearList, user, cell); if (bearList[0].HspdschNum < cell.HSDPA_NotUsedCode) { //返回最接近的承载 return availbaleBearList[0]; } else { return null; } }
/// <summary> /// 计算EcIo的Io,包括本小区干扰、邻小区干扰、异制式干扰和终端背景噪声 /// </summary> /// <param name="user"></param> public void CalcCPICH_Io(UMTSSimUser user) { float intraInterf = m_CommonParam.ServiceProvider.UMTSInterfCalc.CalcIor(user.MaxRSCPCell, user); float interInterf = CalcDLInterInterf(user.MaxRSCPCell, user); user.No = (float)UnitTrans.dBmTomw(m_CommonParam.UMTSUIParam.ThermalNoise) * 3840000 * (float)UnitTrans.dBmTomw(user.Terminal.NoiseFigure); user.Io = intraInterf + interInterf + user.No + user.UlInterfFromOtherSys; }
/// <summary> /// 计算用户的EcIo,Todo··· /// </summary> /// <param name="user"></param> public void CalcEcIo(UMTSSimUser user) { user.DLLoss = (float)UnitTrans.dBto(m_CommonParams.ServiceProvider.LinkLossCalc.GetLinkLoss( NetWorkType.UMTS, user.MaxRSCPCell.Cell.ID, user.TrafficUser.Id, LinkType.Downlink)); user.Ior = m_UMTSInterfCalc.CalcIor(user.MaxRSCPCell,user); List<ISimCellBase> tranList = new List<ISimCellBase>(); tranList.Add(user.MaxRSCPCell); tranList.AddRange(user.MaxRSCPCell.UMTSInterfCells); foreach (UMTSSimCell cell in tranList) { if (!object.ReferenceEquals(user.MaxRSCPCell,cell)) { float linkLoss = (float)UnitTrans.dBto(m_CommonParams.ServiceProvider.LinkLossCalc.GetLinkLoss( NetWorkType.UMTS, user.MaxRSCPCell.Cell.ID, user.TrafficUser.Id, LinkType.Downlink)); user.DLLoss = linkLoss; user.Ioc += m_UMTSInterfCalc.CalcIoc(user.MaxRSCPCell, cell, user); } } m_UMTSInterfCalc.OtherSysInterfCalcDL(user.MaxRSCPCell,user); user.Ioc += user.DlInterfFromOtherSystemCell; user.No = (float)UnitTrans.dBmTomw(m_CommonParams.UMTSUIParam.ThermalNoise) * 3840000 * (float)UnitTrans.dBmTomw(user.Terminal.NoiseFigure); user.Io = user.Ior + user.Ioc + user.No; user.DLLoss = (float)UnitTrans.dBto(m_CommonParams.ServiceProvider.LinkLossCalc.GetLinkLoss( NetWorkType.UMTS, user.MaxRSCPCell.Cell.ID, user.TrafficUser.Id, LinkType.Downlink)); user.RSCP = (float)UnitTrans.dBmTomw(user.MaxRSCPCell.CPICHPower) / user.DLLoss; user.EcIo = user.RSCP / user.Io; }
/// <summary> /// 更新用户缓冲区和请求速率 /// </summary> /// <param name="user">用户</param> private void UpdateBufferAndReqTrafficRate(UMTSSimUser user) { if (user.ServiceType == CommonServiceType.CSService) { UnionCsService csService = user.TrafficUser.Service as UnionCsService; user.BufferData += Convert.ToInt32(csService.DlAveRate / 0.5); if (user.BufferData > 290) { user.RequestRate = user.BufferData * 500f; user.IsCanSchedule = true; } else { user.IsCanSchedule = false; } } if (user.ServiceType == CommonServiceType.PSService) { user.IsCanSchedule = true; if (!user.IsReTrans) { UnionPsService psService = user.TrafficUser.Service as UnionPsService; user.BufferData += Convert.ToInt32(psService.DlAveThroughputDemand / 0.5); user.RequestRate = user.BufferData * 500f; } else { UnionPsService psService = user.TrafficUser.Service as UnionPsService; user.BufferData += Convert.ToInt32(psService.DlAveThroughputDemand / 0.5); } } }
/// <summary> /// 计算上行软切换增益 /// </summary> /// <param name="user"></param> /// <returns></returns> public float CalcULSHOGain(UMTSSimUser user) { if (!user.IsSHO) return 1f; float maxCellCIR = GetMaxCellCIR(user); float maxSiteCIR = GetMaxSiteCIR(user); return maxSiteCIR / maxCellCIR; }
/// <summary> /// 计算下行EbNt的Nt /// </summary> /// <param name="user"></param> /// <param name="cell"></param> /// <returns></returns> public float CalcDLNt(UMTSSimCell cell ,UMTSSimUser user) { float intraInterf = m_CommonParam.ServiceProvider.UMTSInterfCalc.CalcIor(user.MaxRSCPCell, user); float interInterf = CalcDLInterInterf(user.MaxRSCPCell, user); user.No = (float)UnitTrans.dBmTomw(m_CommonParam.UMTSUIParam.ThermalNoise) * 3840000 * (float)UnitTrans.dBmTomw(user.Terminal.NoiseFigure); float userDLNt = (1 - m_CommonParam.UMTSUIParam.OrthCoef) * intraInterf + interInterf + user.No + user.UlInterfFromOtherSys; return userDLNt; }
public void MyTestInitialize() { m_Context = MockContext.CreatContext(); m_Param = new R99_CommonParam(m_Context); m_UlUser = MockUser.CreatUMTSCSUser(); m_DlUser = MockUser.CreatUMTSCSUser(); m_DlUser.LinkType = LinkType.Downlink; }
public void Init() { context = MockContext.CreatContext(); commonParam = new HSUPA_CommonParam(context); bearerSelector = new HSUPA_BearerSelector(commonParam); user = MockUser.CreatUMTSPSUser(); user.HSUPABearer = bearerSelector.GetBearByRate(100000, 0.002f); }
private float CalcDLInterInterf(UMTSSimCell cell, UMTSSimUser user) { float interInterf = 0f; foreach (UMTSSimCell interfCell in cell.UMTSInterfCells) { interInterf += m_CommonParam.ServiceProvider.UMTSInterfCalc.CalcIoc(cell, interfCell, user); } return interInterf; }
/// <summary> /// 计算上行EbNt,dB值 /// </summary> /// <param name="user"></param> /// <param name="supposedTxPower"></param> /// <returns></returns> public float CalcULEbNt(UMTSSimUser user, float supposedTxPower) { float currentTxPower = user.TxPower; user.TxPower = supposedTxPower; //float tempt = m_CalcSHOGain.GetMaxCellCIR(user); float ulEbNt = m_CalcSHOGain.GetMaxSiteCIR(user) * (m_CommonParam.UMTSUIParam.Rc / (user.R99Bearer.ULNominalRate * 1000)); user.TxPower = currentTxPower; return (float)UnitTrans.todB(ulEbNt); }
/// <summary> /// 计算用户到本制式所有小区的rscp /// </summary> /// <param name="user"></param> /// <param name="list"></param> private void CalcRscp(UMTSSimUser user, List<UMTSSimCell> cellList, IGetLinkloss linkLoss) { foreach (UMTSSimCell cell in cellList) { float pilotPower = cell.NECell.PilotPower; float dlLinkLoss = linkLoss.GetLinkLoss(NetWorkType.UMTS,cell.NECell.ID,user.TrafficUser.Id ,LinkType.Downlink); cell.Rscp = pilotPower - dlLinkLoss; } }
public float GetMaxSiteCIR(UMTSSimUser user) { Dictionary<IASite, SofterHandOffValue> shoSites = new Dictionary<IASite, SofterHandOffValue>(); foreach (KeyValuePair<int, LinkParam> kvp in user.ServedLinkSet) { AddCellCIRInSameSite(kvp, shoSites); } return CalcMaxSiteCIR(shoSites, user); }
//构造使用CS业务的UMTS用户 public static UMTSSimUser CreateUMTSSimUser_CS() { IACell cell = new UMTSCell(); User user = CreateUser_CS(); UMTSSimUser umtsSimuser = new UMTSSimUser(user); umtsSimuser.MaxRSCPCell = new UMTSSimCell(cell); umtsSimuser.TrafficUser = new User(); umtsSimuser.TrafficUser.Service = new UnionCsService(); return umtsSimuser; }
public float CalcULNt(UMTSSimCell cell, UMTSSimUser user) { float ulLoss = float.MinValue; //除去当前计算链路的全带宽的接收功率(干扰) float cellIo = 0.0f; ulLoss = m_CommonParam.ServiceProvider.LinkLossCalc.GetLinkLoss(NetWorkType.UMTS, cell.NECell.ID, user.TrafficUser.Id, LinkType.Uplink); cellIo = cell.CurRxPower - user.TxPower / (float)UnitTrans.dBto(ulLoss); //CurRxPower里面已经包含背景噪声和异系统干扰 return cellIo; }
//public static float SubtractPowerTodBm(float power1, float power2) //{ // return (float)UnitTrans.mwTodBm(UnitTrans.dBmTomw(power1) - UnitTrans.dBmTomw(power2)); //} public List<UMTSSimCell> FormUMTSSimCellList(UMTSSimUser user) { List<UMTSSimCell> umtsSimCellList = new List<UMTSSimCell>(); umtsSimCellList.Add(user.MaxRSCPCell); foreach (ISimCellBase cell in user.MaxRSCPCell.UMTSInterfCells) { UMTSSimCell umtsSimCell = (UMTSSimCell)cell; umtsSimCellList.Add(umtsSimCell); } return umtsSimCellList; }
/// <summary> /// 封装用户 /// </summary> /// <param name="context">快照参数类</param> /// <returns></returns> public List<UMTSSimUser> EncapsulateUsers(SnapshotContext context) { List<UMTSSimUser> umtsUserList = new List<UMTSSimUser>(); List<User> trafficUserList = context.Lookup<List<User>>(ContextKeys.PreAccessUsers); foreach (User user in trafficUserList) { UMTSSimUser simUser = new UMTSSimUser(user); umtsUserList.Add(simUser); } return umtsUserList; }
public void Init() { serviceCHType = new HSUPA_ConfirmServiceAcceptedCHType(); context = MockContext.CreatContext(); commonParam = new HSUPA_CommonParam(context); user = MockUser.CreatUMTSPSUser(); user2 = MockUser.CreatUMTSCSUser(); commonParam.UserCol.PreAccessedUser.Add(user2); commonParam.UserCol.PreAccessedUser.Add(user); serviceCHType.CommonParam = commonParam; }
private void RunAccess(UMTSSimUser user,bool isSHOState) { if (user.LinkType == LinkType.Uplink) { user.IsAccess = ULACMethod(user, isSHOState); } else { user.IsAccess = DLACMethod(user, isSHOState); } }
/// <summary> /// 得到激活集所有链路中最大的CIR /// </summary> /// <param name="user"></param> /// <returns></returns> public float GetMaxCellCIR(UMTSSimUser user) { float maxCellCIR = float.MinValue; foreach (KeyValuePair<int, LinkParam> kvp in user.ServedLinkSet) { kvp.Value.ULCIR = GetULCIR(kvp.Value.ServeSet, user); if (maxCellCIR < kvp.Value.ULCIR) maxCellCIR = kvp.Value.ULCIR; } return maxCellCIR; }
private void JudgeIfOverHSPA(UMTSSimUser user) { if (user.EnableCsOverHspa) { user.ServiceAcceptedCH=ServiveAcceptedCH.E_DPDCH; } else { user.ServiceAcceptedCH = ServiveAcceptedCH.None; } }
public UMTSHSDPABearer FindBearByIndex(UMTSSimUser user) { foreach (UMTSHSDPABearer bear in m_BearList) { if ((int)(bear.BLER) == user.BearerIndex) { return bear; } } return null; }
private void JudgeIfSupportHSUPA(UMTSSimUser user) { if (user.EnableHsupa) { user.ServiceAcceptedCH = ServiveAcceptedCH.E_DPDCH; } else { user.ServiceAcceptedCH = ServiveAcceptedCH.None; } }
/// <summary> /// 确定用户TTI长度 /// </summary> /// <param name="cell">HSUPA小区</param> /// <param name="user">HSUPA用户</param> private void JudgeTTILength(UMTSSimUser user) { if (user.MinTTIInterval != m_commonParam.TTI2 || user.AveTrafficRate * 1000 < m_commonParam.TTI10MaxRate) { user.Tti = m_commonParam.TTI10; } else { //user.BestServer.ShotTTIUserLeft--; user.Tti = m_commonParam.TTI2; } }
private bool JudgeIfCanScheduledSuccess(UMTSSimCell cell, UMTSSimUser user, bool IsScheduledSuccessed) { if (user.HSUPABearer == null) { IsScheduledSuccessed = false; } else { IsScheduledSuccessed = JudgeNoiseRise(cell, user); } return IsScheduledSuccessed; }
/// <summary> /// 本小区干扰 /// </summary> /// <param name="cell"></param> /// <param name="user"></param> /// <returns></returns> private float CalcDLIntraIntf(UMTSSimCell cell, UMTSSimUser user) { float IntraIntf = 0f; if (cell.CellType == CarrierTypeOfUMTS.HSDPA) { IntraIntf = HSDPA_CommonCalc.CalcIntraIntf(m_UIParam.OrthCoef, cell.HSDPA_UsedPower, user.AssignedPower, cell.HSDPA_UsedHsscchPower, (float)UnitTrans.dBmTomw(cell.NECell.PilotPower), user.DLLoss); } else if (cell.CellType == CarrierTypeOfUMTS.R99AndHSDPA) { IntraIntf = HSDPA_CommonCalc.CalcIntraIntf(m_UIParam.OrthCoef, cell.HSDPA_UsedPower, user.AssignedPower, cell.HSDPA_UsedHsscchPower, cell.CurTxPower, user.DLLoss); } return IntraIntf; }
/// <summary> /// 对终端上行进行功率调整 /// </summary> /// <param name="user"></param> /// <returns>终端发射功率增加值(可能为负)</returns> private float ULPowerControl(UMTSSimUser user) { float deltaPower = 0f; //判断功率是否受限 float requiredTxPower = GetRequiredTxPower(user); bool isULPowerRestriction = IsULPowerRestriction(user, ref requiredTxPower, ref deltaPower); if (!isULPowerRestriction) { bool isNoiseRiseRestriction = IsULNoiseRestriction(user,requiredTxPower,ref deltaPower); } return deltaPower; }
private void PowerControl(UMTSSimUser user) { if (user.LinkType == LinkType.Uplink) { float deltaPower = ULPowerControl(user); //记录本次迭代用户的上行发射功率 RecordEachIterationUserTxPower(user); UpdateCellRxPower(user, deltaPower); } else { DLPowerControl(user); } }
/// <summary> /// 得到下行链路损耗 /// </summary> /// <param name="carrier">载波</param> /// <param name="user">用户</param> /// <returns>下行链路损耗</returns> public float GetDLLinkLoss(ISimCellBase cell, UMTSSimUser user,bool flag) { LinkLoss = m_LinkLoss.GetLinkLoss(NetWorkType.UMTS, cell.Cell.ID, user.TrafficUser.Id, LinkType.Downlink); if (flag) { FastFading = m_CommonParam.ServiceProvider.FastFadingCalc.GetFastFadingdB(cell, user, LinkType.Downlink); } else { FastFading = 0; } TotalLoss = LinkLoss + FastFading; return TotalLoss; }
/// <summary> /// 本制式内邻小区干扰 /// </summary> /// <param name="cell"></param> /// <param name="user"></param> /// <returns></returns> private float CalcUMTSInterIntf(UMTSSimCell cell, UMTSSimUser user) { float intf = 0.0f; Signal usefulSignal = new Signal(); usefulSignal.NetType = NetWorkType.UMTS; usefulSignal.LinkType = LinkType.Downlink; usefulSignal.FreqBand = cell.NECell.FreqBand.BandWidth; usefulSignal.Frequency = cell.DlFrequency; foreach (UMTSSimCell UMTScell in cell.UMTSInterfCells) { GetUMTSInterIntf(UMTScell, user, usefulSignal, ref intf); } return intf; }