private static void UpdateNearestCell(ISimUser user, ref ISimCellBase nearestCell, ref float minDistance, ISimCellBase cellBase) { GeoXYPoint trancXY = new GeoXYPoint(cellBase.X, cellBase.Y); GeoXYPoint userXY = new GeoXYPoint(user.X, user.Y); GeoXYLine trancToUser = new GeoXYLine(trancXY, userXY); FindNearestCell(ref nearestCell, ref minDistance, cellBase, trancToUser); }
private static ISimCellBase SetNearestCell(List<ISimCellBase> cells, ISimCellBase nearestCell) { if (cells.Count != 0) { nearestCell = cells[0]; } return nearestCell; }
/// <summary> /// 获取一个GSM用户到各个制式的总路损 /// </summary> /// <param name="user"></param> /// <param name="carrier"></param> /// <param name="isDL"></param> /// <returns></returns> public float GetAllLoss(GSMSimUser user, ISimCellBase carrier, NetWorkType netType, bool isDL) { if (isDL) return m_GetLinkLoss.GetLinkLoss(netType, carrier.Cell.ID, user.TrafficUser.Id, LinkType.Downlink); else return m_GetLinkLoss.GetLinkLoss(netType, carrier.Cell.ID, user.TrafficUser.Id, LinkType.Uplink); }
private static void CalcNearestCell(ISimUser user, ref ISimCellBase nearestCell, ref float minDistance, ISimCellBase cellBase) { bool isUserNear = IsUserNear(user, cellBase); if (!isUserNear) { UpdateNearestCell(user, ref nearestCell, ref minDistance, cellBase); } }
private static ISimCellBase CheckNearestCell(List<ISimCellBase> cells, ISimCellBase nearestCell) { if (nearestCell == null) { nearestCell = SetNearestCell(cells, nearestCell); } return nearestCell; }
private static void FindNearestCell(ref ISimCellBase nearestCell, ref float minDistance, ISimCellBase cellBase, GeoXYLine trancToUser) { float distance = (float)trancToUser.GetDistance(); if (distance < minDistance && distance < GetCalcRadius(cellBase)) { minDistance = distance; nearestCell = cellBase; } }
public void Initial() { m_Collection = new TDSimCellCollection(); m_Cell = MockTDSimCell.CreatTDSimCell(); m_GSMInterfCell=MockIntefGSMSimTRX.CreatGSMSimTRX(); m_UMTSInterCell=MockIntefUMTSSimCell.CreatUMTSSimCell(); m_Collection.TDCells.Add(m_Cell); m_Collection.GSMIntefCells.Add(m_GSMInterfCell); m_Collection.UMTSIntefCells.Add(m_UMTSInterCell); m_InitialTdNE = new InitialTdNE(); }
public float GetFastFadingdB(ISimCellBase carrier, ISimUser user, LinkType type) { float speed = user.TrafficUser.Mobility.MeanSpeed; float frequency = (float)(carrier.Cell.FreqBand.DLFrequency * 1e6); //ChannelTypeManage CTManage = new ChannelTypeManage(); //CTManage.GetChannelTypeInfo(); ChannelType CT = m_CTManage.SpeedChannelDic[speed]; ChannelModel CM = new ChannelModel(CT.ChannelPath, speed, frequency); CalcFastFading calc = new CalcFastFading(10); return calc.GetFastFadingdB(CM, m_TimeSpan); }
/// <summary> /// 获取给定阈值内邻小区 /// </summary> /// <param name="targetCell">目标小区</param> /// <param name="Cells">备选邻小区集合</param> /// <param name="maxInterNum">邻小区集合元素数阈值</param> /// <returns>符合条件的邻小区集合</returns> public List<ISimCellBase> GetNeighbourCells(ISimCellBase targetCell, List<ISimCellBase> Cells,int maxInterNum) { List<ISimCellBase> neighbourCells = new List<ISimCellBase>(); SortedCell targetSortCell = new SortedCell(targetCell); //获取包装后的小区列表 List<SortedCell> toBeSortedCells = GetToBeSortedCell(Cells); //获取排序后的邻小区 List<SortedCell> neighbourSortedCell = GetSortedCells(targetSortCell, toBeSortedCells); //依据最大切换小区阈值确定最终小区列表 neighbourSortedCell = GetSortedCellinMaxInterNum(neighbourSortedCell, maxInterNum); //将小区拆包装 return GetCellBaseList(neighbourSortedCell); }
/// <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="ue"></param> /// <param name="cell"></param> /// <param name="usefulsg"></param> /// <param name="intersg"></param> /// <returns></returns> private float CalcSystemUluser(TDSimUser ue,ISimCellBase cell,Signal usefulsg,Signal intersg) { float ueinter = 0; InterfResult dbinter; foreach (ISimUser user in cell.ULSimUsers) { intersg.RxPower = user.UlPower - m_LinkLoss.GetULTotalLoss(user, ue.ServiceCell); intersg.Frequency = cell.UlFrequency; dbinter = m_InterfCalc.CalcOneSourceInf(usefulsg, intersg); ueinter += CalcOtherSystem(dbinter); } return ueinter; }
/// <summary> /// 获取计算半径 /// </summary> /// <param name="tran"></param> /// <returns></returns> private double CalcRadius(ISimCellBase tran) { int calcRadius = 0; foreach (PropModelConfig pmc in tran.Cell.PropModels) { calcRadius = UpdateCalcRadius(calcRadius, pmc); } return calcRadius; }
/// <summary> /// 异系统小区对GSM小区的干扰 /// </summary> /// <param name="user"></param> /// <param name="isCalcDLBCCH"></param> /// <param name="isDL"></param> /// <param name="otherSysCell"></param> /// <param name="netType"></param> protected void CalcOtherNetOneSrcInterf(GSMSimUser user, bool isCalcDLBCCH, bool isDL, ISimCellBase otherSysCell, NetWorkType netType) { GSMSimTRX usefulTrx = FindUsefulTrx(user, isCalcDLBCCH, isDL); Signal usefulSignal = BuildGsmSignal(usefulTrx, isDL); Signal source = new Signal(); source.FreqBand = otherSysCell.Cell.FreqBand.BandWidth; source.Frequency = otherSysCell.DlFrequency; source.LinkType = LinkType.Downlink; source.RxPower = otherSysCell.DlPower - m_TotalLossCalc.GetAllLoss(user, otherSysCell, netType, isDL); InterfResult res = m_InterfCalc.CalcOneSourceInf(usefulSignal, source); InitBCIandSE(res); if ((res.SE == float.NegativeInfinity) & (res.BCI == float.NegativeInfinity)) return; m_IsUserCsService = true; ReviseInterfResultByDTX(user, res); ConsiderHopping(usefulTrx, res); OtherNetResult(user, isCalcDLBCCH, isDL, netType, res); }
private void CalcOtherNetIMP3Interf(GSMSimUser user, bool isCalcDLBCCH, bool isDL, NetWorkType netType, ISimCellBase carrier1, ISimCellBase carrier2) { GSMSimTRX userTrx = FindUsefulTrx(user, isCalcDLBCCH, isDL); Signal userSignal = BuildGsmSignal(userTrx, isDL); Signal s1 = new Signal(); SetSignalFrequency(isDL, carrier1, s1); s1.FreqBand = carrier1.Cell.FreqBand.BandWidth; s1.NetType = netType; float loss1 = m_TotalLossCalc.GetAllLoss(user, carrier1, netType, isDL); s1.RxPower = carrier1.DlPower - loss1; Signal s2 = new Signal(); SetSignalFrequency(isDL, carrier2, s2); s2.FreqBand = carrier2.Cell.FreqBand.BandWidth; s2.NetType = netType; float loss2 = m_TotalLossCalc.GetAllLoss(user, carrier2, netType, isDL); s2.RxPower = carrier2.DlPower - loss2; float toi = float.MaxValue; InterfResult res = m_InterfCalc.CalcTwoSourceInf(userSignal, s1, s2, toi); //如果干扰很小返回,不计 if (res.IMP3 == float.NegativeInfinity) return; m_User = user; m_IsDL = isDL; m_IsCalcDLBCCH = isCalcDLBCCH; IMP3Params imp3Params = new IMP3Params(); imp3Params.isSource1DTX = false; imp3Params.isSource2DTX = false; ReviseInterfResultByDTX(user, res); //如果被干扰信号跳频 if (userTrx.NeTRX.TRXType != TRXType.BCCH & userTrx.NeTRX.HopMode != HoppingMode.NonHopping) { res.IMP3 += (float)UnitTrans.todB((double)1 / userTrx.NeTRX.MALList.Count); } Imp3Result(user, isDL, netType, res); }
private static bool IsUserNear(ISimUser user, ISimCellBase cellBase) { bool isUserXNear = Math.Abs(user.X - cellBase.X) > GetCalcRadius(cellBase); bool isUserYNear = Math.Abs(user.Y - cellBase.Y) > GetCalcRadius(cellBase); return (isUserXNear || isUserYNear); }
/// <summary> /// 设定信号的频率 /// </summary> private void SetSignalFrequency(bool isDL, ISimCellBase carrier1, Signal s1) { if (isDL) s1.Frequency = carrier1.Cell.FreqBand.DLFrequency; else s1.Frequency = carrier1.Cell.FreqBand.ULFrequency; }
public float GetFastFadingdB(ISimCellBase cell, ISimUser user, LinkType type) { return 110; }
/// <summary> /// 获取计算半径 /// </summary> /// <param name="tran"></param> /// <returns></returns> private static int GetCalcRadius(ISimCellBase cell) { int calcRadius = 0; foreach (PropModelConfig pmc in cell.Cell.PropModels) { calcRadius = UpdateCalcRadius(calcRadius, pmc); } return calcRadius; }